Skip to content

Commit cae4bd3

Browse files
committed
Re-add effect transform check
1 parent 5ba0310 commit cae4bd3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Drawable.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ const getLocalPosition = (drawable, vec) => {
4141
// localPosition matches that transformation.
4242
localPosition[0] = 0.5 - (((v0 * m[0]) + (v1 * m[4]) + m[12]) / d);
4343
localPosition[1] = (((v0 * m[1]) + (v1 * m[5]) + m[13]) / d) + 0.5;
44-
if (drawable.enabledEffects !== 0) EffectTransform.transformPoint(drawable, localPosition, localPosition);
44+
// Apply texture effect transform if the localPosition is within the drawable's space,
45+
// and any effects are currently active.
46+
if (drawable.enabledEffects !== 0 &&
47+
(localPosition[0] >= 0 && localPosition[0] < 1) &&
48+
(localPosition[1] >= 0 && localPosition[1] < 1)) {
49+
50+
EffectTransform.transformPoint(drawable, localPosition, localPosition);
51+
}
4552
return localPosition;
4653
};
4754

0 commit comments

Comments
 (0)