Class: VectorSalad::StandardShapes::Jitter

Inherits:
Transform
  • Object
show all
Defined in:
lib/vector_salad/standard_shapes/jitter.rb

Overview

Jitter the position of nodes in the contained shapes randomly.

Instance Method Summary collapse

Constructor Details

#initialize(max, min: 0, fn: nil, canvas:, **_options, &block) ⇒ Jitter

Returns a new instance of Jitter.



26
27
28
29
30
31
32
# File 'lib/vector_salad/standard_shapes/jitter.rb', line 26

def initialize(max, min: 0, fn: nil, canvas:, **_options, &block)
  instance_eval(&block) # inner_canvas is populated

  @canvas.each do |shape|
    canvas << shape.jitter(max, min: min, fn: fn)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class VectorSalad::DSL