class Fox::Canvas::LineShape
Attributes
lineCap[RW]
lineJoin[RW]
lineStyle[RW]
lineWidth[RW]
x1[RW]
x2[RW]
y1[RW]
y2[RW]
Public Class Methods
new(x1, y1, x2, y2)
click to toggle source
Calls superclass method
Fox::Canvas::Shape::new
# File lib/fox16/canvas.rb, line 183 def initialize(x1, y1, x2, y2) super(x1, y1) @x1, @y1, @x2, @y2 = x1, y1, x2, y2 @lineWidth = 1 @lineCap = CAP_NOT_LAST @lineJoin = JOIN_MITER @lineStyle = LINE_SOLID end
Public Instance Methods
draw(dc)
click to toggle source
# File lib/fox16/canvas.rb, line 200 def draw(dc) apply_dc(dc) do # Save old values oldLineWidth = dc.lineWidth oldLineCap = dc.lineCap oldLineJoin = dc.lineJoin oldLineStyle = dc.lineStyle # Set properties for this line dc.lineWidth = lineWidth dc.lineCap = lineCap dc.lineJoin = lineJoin dc.lineStyle = lineStyle # Draw the line dc.drawLine(x1, y1, x2, y2) # Restore old properties dc.lineWidth = oldLineWidth dc.lineCap = oldLineCap dc.lineJoin = oldLineJoin dc.lineStyle = oldLineStyle end end
height()
click to toggle source
# File lib/fox16/canvas.rb, line 196 def height 0 end
width()
click to toggle source
# File lib/fox16/canvas.rb, line 192 def width 0 end