Class: VectorSalad::StandardShapes::Scale
- Inherits:
-
Transform
- Object
- Transform
- VectorSalad::StandardShapes::Scale
- Defined in:
- lib/vector_salad/standard_shapes/scale.rb
Overview
Scale the contained shapes by multiplier about the origin.
Instance Method Summary (collapse)
-
- (Any) initialize(x_multiplier, y_multiplier = x_multiplier, canvas:, **_options, &block)
constructor
Supply just 1 multiplier to scale evenly, or x and y multipliers to stretch or squash the axies.
Constructor Details
- (Any) initialize(x_multiplier, y_multiplier = x_multiplier, canvas:, **_options, &block)
Supply just 1 multiplier to scale evenly, or x and y multipliers to stretch or squash the axies.
24 25 26 27 28 29 30 31 32 |
# File 'lib/vector_salad/standard_shapes/scale.rb', line 24 def initialize(x_multiplier, y_multiplier = x_multiplier, canvas:, **, &block) instance_eval(&block) # inner_canvas is populated @canvas.each do |shape| canvas << shape.scale(x_multiplier, y_multiplier) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class VectorSalad::DSL