label: fix redrawing shadow on label updates (#599)

This commit is contained in:
Maximilian Seidler 2024-12-22 14:53:52 +00:00 committed by GitHub
parent 83bda4883d
commit 002e44f627
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -119,7 +119,10 @@ bool CLabel::draw(const SRenderData& data) {
if (!asset)
return true;
}
if (updateShadow) {
updateShadow = false;
shadow.markShadowDirty();
}
@ -143,7 +146,7 @@ void CLabel::renderUpdate() {
asset = newAsset;
resourceID = pendingResourceID;
pendingResourceID = "";
shadow.markShadowDirty();
updateShadow = true;
} else {
Debug::log(WARN, "Asset {} not available after the asyncResourceGatherer's callback!", pendingResourceID);

View file

@ -45,4 +45,5 @@ class CLabel : public IWidget {
std::shared_ptr<CTimer> labelTimer = nullptr;
CShadowable shadow;
bool updateShadow = true;
};