Class: SVG::Transform
- Inherits:
-
Object
- Object
- SVG::Transform
- Defined in:
- lib/svg/transform.rb
Instance Method Summary (collapse)
-
- (Object) scale(xscale, yscale = xscale)
Sets the x- and y-axis scaling factors.
-
- (String) to_s
The transform as an SVG formatted transformation string.
-
- (Hash) transform
The internally tracked transformation properties.
-
- (Object) translate(x, y = 0)
Sets the x- and y-axis translation positions.
Instance Method Details
- (Object) scale(xscale, yscale = xscale)
Sets the x- and y-axis scaling factors.
10 11 12 |
# File 'lib/svg/transform.rb', line 10 def scale(xscale, yscale = xscale) transform[:scale] = [xscale, yscale] end |
- (String) to_s
The transform as an SVG formatted transformation string
25 26 27 28 29 |
# File 'lib/svg/transform.rb', line 25 def to_s transform.map do |key, values| "%s(%s)" % [key, values.join(", ")] end.join " " end |
- (Hash) transform
The internally tracked transformation properties
32 33 34 |
# File 'lib/svg/transform.rb', line 32 def transform @transform ||= {} end |
- (Object) translate(x, y = 0)
Sets the x- and y-axis translation positions.
20 21 22 |
# File 'lib/svg/transform.rb', line 20 def translate(x, y = 0) transform[:translate] = [x, y] end |