You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
Describe the bug
Highlights don't reappear if you set the same highlight you just cleared.
To Reproduce
Create a Custom PDF with the following script and pop it out:
functiononPickUp()
self.Book.setHighlight(0.2, 0.2, 0.8, 0.8)
endfunctiononDrop()
self.Book.clearHighlight()
end
Pick it up. The highlight should appear.
Put it back down. The highlight should disappear.
Pick it up again. The highlight does not appear.
This bug seems to persist between loads. If the highlight doesn't appear for you the first time either, its probably because that region was highlighted before a reload.
Expected behavior
The highlight should appear again. This behaves as expected when setting different highlight regions with different parameters, this only seems to happen when a highlight is cleared, and then a highlight with the exact same parameters is applied. The same region can be set again if a different highlight is applied by script or by user interaction.
Tabletop Simulator Info (please complete the following information):
OS: Windows 10
Version: v12.3.5
Known workarounds
The cleanest workaround would be to use setHighlight(2, 2, 2, 2) instead of clearHighlight(). This sets the highlight to a small dot that is always off-screen.
Additional context
If I had to guess, under the hood, setHighlight() is skipped if there's already a highlight in the exact same spot, and clearHighlight() makes the highlight invisible without actually updating where it is, so setHighlight() sees there's already a highlight exactly where it wants to go, and skips itself without realizing the old highlight is invisible.
The text was updated successfully, but these errors were encountered:
Describe the bug
Highlights don't reappear if you set the same highlight you just cleared.
To Reproduce
This bug seems to persist between loads. If the highlight doesn't appear for you the first time either, its probably because that region was highlighted before a reload.
Expected behavior
The highlight should appear again. This behaves as expected when setting different highlight regions with different parameters, this only seems to happen when a highlight is cleared, and then a highlight with the exact same parameters is applied. The same region can be set again if a different highlight is applied by script or by user interaction.
Tabletop Simulator Info (please complete the following information):
Known workarounds
The cleanest workaround would be to use
setHighlight(2, 2, 2, 2)
instead ofclearHighlight()
. This sets the highlight to a small dot that is always off-screen.Additional context
If I had to guess, under the hood,
setHighlight()
is skipped if there's already a highlight in the exact same spot, andclearHighlight()
makes the highlight invisible without actually updating where it is, sosetHighlight()
sees there's already a highlight exactly where it wants to go, and skips itself without realizing the old highlight is invisible.The text was updated successfully, but these errors were encountered: