Class: Plushie::Canvas::Shape::Clip
- Inherits:
-
Data
- Object
- Data
- Plushie::Canvas::Shape::Clip
- Defined in:
- lib/plushie/canvas/shape/clip.rb
Overview
Clipping rectangle value type for canvas groups.
Instance Attribute Summary collapse
-
#h ⇒ Object
readonly
Returns the value of attribute h.
-
#w ⇒ Object
readonly
Returns the value of attribute w.
-
#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:, w:, h:) ⇒ Clip
constructor
A new instance of Clip.
-
#to_wire ⇒ Hash
Wire-ready clip map.
Constructor Details
#initialize(x:, y:, w:, h:) ⇒ Clip
Returns a new instance of Clip.
11 12 13 |
# File 'lib/plushie/canvas/shape/clip.rb', line 11 def initialize(x:, y:, w:, h:) super end |
Instance Attribute Details
#h ⇒ Object (readonly)
Returns the value of attribute h
10 11 12 |
# File 'lib/plushie/canvas/shape/clip.rb', line 10 def h @h end |
#w ⇒ Object (readonly)
Returns the value of attribute w
10 11 12 |
# File 'lib/plushie/canvas/shape/clip.rb', line 10 def w @w end |
#x ⇒ Object (readonly)
Returns the value of attribute x
10 11 12 |
# File 'lib/plushie/canvas/shape/clip.rb', line 10 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y
10 11 12 |
# File 'lib/plushie/canvas/shape/clip.rb', line 10 def y @y end |
Instance Method Details
#to_wire ⇒ Hash
Returns wire-ready clip map.
16 17 18 |
# File 'lib/plushie/canvas/shape/clip.rb', line 16 def to_wire {type: "clip", x: x, y: y, w: w, h: h} end |