Class: Compass::Canvas::Backend::Interface::Path
- Defined in:
- lib/canvas/backend/interface/path.rb
Overview
Interface Path class.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#arc(x, y, radius, angle1, angle2) ⇒ Object
Unpacks arguments
X
,Y
,radius
andangle
[1..2] from Sass to Ruby objects. - #arc_reverse(*args) ⇒ Object
-
#curve(x1, y1, x2, y2, x3, y3) ⇒ Object
Unpacks arguments
X
[1..3] andY
[1..3] from Sass to Ruby objects. -
#line(x, y) ⇒ Object
Unpacks arguments
X
andY
from Sass to Ruby objects. -
#move(x, y) ⇒ Object
Unpacks arguments
X
andY
from Sass to Ruby objects. -
#quadratic_curve(x1, y1, x2, y2) ⇒ Object
Unpacks arguments
X
[1..2] andY
[1..2] from Sass to Ruby objects.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Compass::Canvas::Backend::Interface::Base
Instance Method Details
#arc(x, y, radius, angle1, angle2) ⇒ Object
Unpacks arguments X
, Y
, radius
and angle
[1..2] from Sass to Ruby objects.
25 26 27 |
# File 'lib/canvas/backend/interface/path.rb', line 25 def arc(x, y, radius, angle1, angle2) [x.value, y.value, radius.value, angle1.value * (Math::PI / 180.0), angle2.value * (Math::PI / 180.0)] end |
#arc_reverse(*args) ⇒ Object
30 31 32 |
# File 'lib/canvas/backend/interface/path.rb', line 30 def arc_reverse(*args) arc(*args) end |
#curve(x1, y1, x2, y2, x3, y3) ⇒ Object
Unpacks arguments X
[1..3] and Y
[1..3] from Sass to Ruby objects.
15 16 17 |
# File 'lib/canvas/backend/interface/path.rb', line 15 def curve(x1, y1, x2, y2, x3, y3) [x1.value, y1.value, x2.value, y2.value, x3.value, y3.value] end |
#line(x, y) ⇒ Object
Unpacks arguments X
and Y
from Sass to Ruby objects.
10 11 12 |
# File 'lib/canvas/backend/interface/path.rb', line 10 def line(x, y) [x.value, y.value] end |
#move(x, y) ⇒ Object
Unpacks arguments X
and Y
from Sass to Ruby objects.
5 6 7 |
# File 'lib/canvas/backend/interface/path.rb', line 5 def move(x, y) [x.value, y.value] end |
#quadratic_curve(x1, y1, x2, y2) ⇒ Object
Unpacks arguments X
[1..2] and Y
[1..2] from Sass to Ruby objects.
20 21 22 |
# File 'lib/canvas/backend/interface/path.rb', line 20 def quadratic_curve(x1, y1, x2, y2) [x1.value, y1.value, x2.value, y2.value] end |