lib/glimmer/libui/shape/line.rb in glimmer-dsl-libui-0.5.1 vs lib/glimmer/libui/shape/line.rb in glimmer-dsl-libui-0.5.2

- old
+ new

@@ -50,9 +50,18 @@ # if the last 2 args are available, it means that the first 2 args represent the start point # if line is part of a figure, then the last 2 args are ignored and it is never assumed to include # start point !parent.is_a?(Figure) && end_x && end_y end + + def perfect_shape + perfect_shape_dependencies = [x, y, end_x, end_y] + if perfect_shape_dependencies != @perfect_shape_dependencies + x, y, end_x, end_y = @perfect_shape_dependencies = perfect_shape_dependencies + @perfect_shape = PerfectShape::Line.new(points: [[x, y], [end_x, end_y]]) + end + @perfect_shape + end end end end end