Class: RGhost::Scale

Inherits:
PsObject show all
Defined in:
lib/rghost/scale.rb

Overview

Scales objects

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PsObject

#<<, #call, #graphic_scope, #ps, #raw, #set, #to_s

Constructor Details

#initialize(sx, sy) ⇒ Scale

Examples

doc.scale(1,1) #default document scale

doc.scale(1,3)

doc.scale(3,3)



17
18
19
# File 'lib/rghost/scale.rb', line 17

def initialize(sx,sy)
  super("#{sx} #{sy} scale")
end

Class Method Details

.zoom(value = 100) ⇒ Object

Scale proportionally by value in percent

Example

doc.zoom(300) # 300% the same that scale(3,3)



23
24
25
26
27
# File 'lib/rghost/scale.rb', line 23

def self.zoom(value=100)
  
  RGhost::Scale.new(value/100.0,value/100.0)

end