Pile labels are not properly reset on depile
Closed this issue · 4 comments
I got confused about this issue...
I piled up teapot0
and teapot8
, and depiled it. And I logged out (labels, pileId)
in both setPileLabel()
in library.js
and drawLabel()
in pile.js
.
The log info from library.js
is correct, so teapot0
should be called drawLabel()
, but the log info from pile.js
are all about teapot8
, which means teapot0
is never called...
I don't know why this happens 😰
I don't know either but the easiest way to find out is to trace the call path from updated()
to where pile.drawLabel()
in setPileLabel()
. It appears as if teapot8
is drawn twice. Somewhere along this call path teapot0
must get "lost" and the label is drawn twice for teapot8
.
I found the issue 🤦🏻♀️It's because we didn't set isPositioning
correctly, only when isPositioning
is false can we draw labels.
Awesome thanks! 🎉