Skip to content

Commit 81f210a

Browse files
committed
Set convex hull dirty when silhouettes update
1 parent a87c8bb commit 81f210a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Drawable.js

+11
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class Drawable {
123123
this._transformedHullDirty = true;
124124

125125
this._skinWasAltered = this._skinWasAltered.bind(this);
126+
this._silhouetteWasUpdated = this._silhouetteWasUpdated.bind(this);
126127

127128
this.isTouching = this._isTouchingNever;
128129
}
@@ -166,10 +167,12 @@ class Drawable {
166167
if (this._skin !== newSkin) {
167168
if (this._skin) {
168169
this._skin.removeListener(Skin.Events.WasAltered, this._skinWasAltered);
170+
this._skin.removeListener(Skin.Events.SilhouetteUpdated, this._silhouetteWasUpdated);
169171
}
170172
this._skin = newSkin;
171173
if (this._skin) {
172174
this._skin.addListener(Skin.Events.WasAltered, this._skinWasAltered);
175+
this._skin.addListener(Skin.Events.SilhouetteUpdated, this._silhouetteWasUpdated);
173176
}
174177
this._skinWasAltered();
175178
}
@@ -696,6 +699,14 @@ class Drawable {
696699
this.setTransformDirty();
697700
}
698701

702+
/**
703+
* Respond to an internal change in the current Skin's silhouette.
704+
* @private
705+
*/
706+
_silhouetteWasUpdated () {
707+
this.setConvexHullDirty();
708+
}
709+
699710
/**
700711
* Calculate a color to represent the given ID number. At least one component of
701712
* the resulting color will be non-zero if the ID is not RenderConstants.ID_NONE.

0 commit comments

Comments
 (0)