Skip to content

Commit d48d426

Browse files
committed
Set convex hull dirty when silhouettes update
1 parent 2f15a56 commit d48d426

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
}
@@ -730,6 +733,14 @@ class Drawable {
730733
this.setTransformDirty();
731734
}
732735

736+
/**
737+
* Respond to an internal change in the current Skin's silhouette.
738+
* @private
739+
*/
740+
_silhouetteWasUpdated () {
741+
this.setConvexHullDirty();
742+
}
743+
733744
/**
734745
* Calculate a color to represent the given ID number. At least one component of
735746
* the resulting color will be non-zero if the ID is not RenderConstants.ID_NONE.

0 commit comments

Comments
 (0)