class Glimmer::Gtk::Shape::Polyline
Represents a polyline (an open path consisting of lines)
Public Instance Methods
draw_shape(drawing_area_widget, cairo_context)
click to toggle source
# File lib/glimmer/gtk/shape/polyline.rb, line 65 def draw_shape(drawing_area_widget, cairo_context) cairo_context.new_path the_points = points the_points.each_with_index do |point, i| if i == 0 cairo_context.move_to(*point) else cairo_context.line_to(*point) end end end
points()
click to toggle source
# File lib/glimmer/gtk/shape/polyline.rb, line 77 def points the_points = [] @args.each_with_index do |arg, i| if i.even? the_points << [arg] else the_points.last << arg end end the_points end