Module: VectorSalad::Mixins::Transforms
- Includes:
- Contracts::Core
- Included in:
- StandardShapes::Group, StandardShapes::MultiPath
- Defined in:
- lib/vector_salad/mixins/transforms.rb
Overview
Mixin for transforming shapes.
Instance Method Summary (collapse)
- 
  
    
      - (Any) [](x, y) 
    
    
  
  
  
  
  
  
  
  
  
    Move the shape absolutely. 
- 
  
    
      - (Any) move(x, y) 
    
    
  
  
  
  
  
  
  
  
  
    Move the shape relatively. 
- 
  
    
      - (Any) rotate(angle) 
    
    
  
  
  
  
  
  
  
  
  
    Rotates the shape by the specified angle about the origin. 
- 
  
    
      - (Any) scale(multiplier) 
    
    
  
  
  
  
  
  
  
  
  
    Scale a shape by multiplier about the origin. 
Instance Method Details
- (Any) [](x, y)
Move the shape absolutely.
| 13 14 15 | # File 'lib/vector_salad/mixins/transforms.rb', line 13 def [](x, y) each_send(:[], x, y) end | 
- (Any) move(x, y)
Move the shape relatively.
| 19 20 21 | # File 'lib/vector_salad/mixins/transforms.rb', line 19 def move(x, y) each_send(:move, x, y) end | 
- (Any) rotate(angle)
Rotates the shape by the specified angle about the origin.
| 25 26 27 | # File 'lib/vector_salad/mixins/transforms.rb', line 25 def rotate(angle) each_send(:rotate, angle) end | 
- (Any) scale(multiplier)
Scale a shape by multiplier about the origin.
| 31 32 33 | # File 'lib/vector_salad/mixins/transforms.rb', line 31 def scale(multiplier) each_send(:scale, multiplier) end |