awebneck/savage — pull request #9 by qhwa (2014-03-19 02:37:55+00:00)
Title: Path is now transformable.

Paths, sub paths and directions can be transformed now.

For example

~~~ruby
# for path
path = Parser.parse %Q{C211.003,239.997,253.003,197.997,304.003,197.997}
path.scale( 0.5, -0.5 )
path.translate( 0, 100 )
path.to_command
#=> "C105.5015-19.9985 126.5015 1.0015 152.0015 1.0015"
~~~~

More examples can be found in `spec/transformable_spec.rb` .

Some directions are considered "not fully transformable". e.g. `HorizontalTo` directions are not directly rotatable. An error will be raised if they are being rotated or skewed. So two methods , `to_transformable_commands!` and `fully_transformable?` are added to paths and sub_paths.