lib/glimmer/libui/shape/polyline.rb in glimmer-dsl-libui-0.5.2 vs lib/glimmer/libui/shape/polyline.rb in glimmer-dsl-libui-0.5.3
- old
+ new
@@ -37,9 +37,20 @@
::LibUI.draw_path_line_to(path_proxy.libui, alternating_x_y_array[point_alternating_x_y_index + 2], alternating_x_y_array[point_alternating_x_y_index + 3])
end
end
super
end
+
+ def perfect_shape
+ perfect_shape_dependencies = PerfectShape::MultiPoint.normalize_point_array(point_array)
+ if perfect_shape_dependencies != @perfect_shape_dependencies
+ point_array = @perfect_shape_dependencies = perfect_shape_dependencies
+ path_shapes = [point_array.first]
+ path_shapes += point_array.drop(1).map { |point| PerfectShape::Line.new(points: [point]) }
+ @perfect_shape = PerfectShape::Path.new(closed: false, shapes: path_shapes)
+ end
+ @perfect_shape
+ end
end
end
end
end