Shadow on Label disappears permanently and won't come back if Label opacity is ever tweened down to zero #17916
Labels
area-drawing
Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
This is a bizarre bug I can't explain but is easy to reproduce. If you create a Label with a Shadow, then tween that Label's opacity down to zero in Windows, the Shadow disappears and won't come back.
To illustrate, I created the following simple program which just features a few Labels on screen, and on a Timer, will tween their opacity either from 0 to 1 or 1 to 0 depending on the
showHide
int which is toggled between +1 (to show) and -1 (to hide):This is what it looks like if you play it to start:
If you click the screen, these labels will fade out. If you click again, they will fade back in. But now bizarrely their Shadows will be gone:
What is even more interesting is if you comment out the line
labelList[i].Opacity = Math.Clamp(labelList[i].Opacity + showHide * deltaTime/ animationTime, 0, 1);
and let back in the linelabelList[i].Opacity = Math.Clamp(showHide, 0, 1);
so this no longer tweens the opacity but rather sets it hard back and forth between 0 and 1, the same problem does not happen.So this problem is only provoked by tweening opacity. And it only happens in Windows.
I presume there must be some intermediate opacity between 0 and 1 that is triggering a glitch and only in Windows but don't know what specific value it is or why it is happening.
Thanks for any help or solutions.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/jonmdev/Windows-Shadow-Opacity-Bug
Version with bug
7.0.92
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows 10
Did you find any workaround?
If you never tween Label opacities but only hard set them to 0 or 1, this can be avoided. If you also keep the opacity floor above around 0.01 or 0.05 or so (I believe) it doesn't happen. So I presume there is some math or programming error that is happening once Label opacity gets close to zero but not exactly zero.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: