Class: Plushie::Canvas::Shape::Translate
- Inherits:
-
Data
- Object
- Data
- Plushie::Canvas::Shape::Translate
- Defined in:
- lib/plushie/canvas/shape/transform.rb
Overview
Translates the canvas coordinate origin.
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x:, y:) ⇒ Translate
constructor
A new instance of Translate.
-
#to_wire ⇒ Hash
Wire-ready transform map.
Constructor Details
#initialize(x:, y:) ⇒ Translate
Returns a new instance of Translate.
11 12 13 |
# File 'lib/plushie/canvas/shape/transform.rb', line 11 def initialize(x:, y:) super end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x
10 11 12 |
# File 'lib/plushie/canvas/shape/transform.rb', line 10 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y
10 11 12 |
# File 'lib/plushie/canvas/shape/transform.rb', line 10 def y @y end |
Instance Method Details
#to_wire ⇒ Hash
Returns wire-ready transform map.
16 17 18 |
# File 'lib/plushie/canvas/shape/transform.rb', line 16 def to_wire {type: "translate", x: x, y: y} end |