lib/glimmer/libui/perfect_shaped.rb in glimmer-dsl-libui-0.11.2 vs lib/glimmer/libui/perfect_shaped.rb in glimmer-dsl-libui-0.11.3
- old
+ new
@@ -13,16 +13,17 @@
# or if point is on the outline when outline is true
# distance_tolerance is used when outline is true to enable a fuzz factor in
# determining if a point lies on the outline (e.g. makes it easier to select
# a shape by mouse)
def contain?(*point, outline: false, distance_tolerance: 0)
+ # TODO inverse transform point with `uiDrawMatrixTransformPoint` before checking containment
perfect_shape&.contain?(*point, outline: outline, distance_tolerance: distance_tolerance)
end
# Returns if shape includes point on the inside when filled
# or if shape includes point on the outline when stroked
def include?(*point)
- if fill.empty?
+ if respond_to?(:fill) && fill.empty?
# TODO check if distance_tolerance should be half the thickness in case it is checked against both sides of out and in
contain?(*point, outline: true, distance_tolerance: ((stroke[:thickness] || 1) - 1))
else
contain?(*point)
end