lib/glimmer/swt/custom/shape/rectangle.rb in glimmer-dsl-swt-4.20.13.12 vs lib/glimmer/swt/custom/shape/rectangle.rb in glimmer-dsl-swt-4.20.13.13
- old
+ new
@@ -83,9 +83,10 @@
# checks if drawn or filled rectangle includes the point denoted by x and y (if drawn, it only returns true if point lies on the edge)
def include?(x, y)
if filled?
contain?(x, y)
else
+ x, y = inverse_transform_point(x, y)
comparison_lines = absolute_point_xy_array.zip(absolute_point_xy_array.rotate(1))
comparison_lines.any? {|line| Line.include?(line.first.first, line.first.last, line.last.first, line.last.last, x, y)}
end
end