Skip to content

Commit

Permalink
Optimize redraw: ElemSetGlow() checks for GlowEn
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpulseAdventure committed Sep 1, 2019
1 parent ddf0f22 commit 4c37e54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/GUIslice.c
Original file line number Diff line number Diff line change
Expand Up @@ -3395,12 +3395,14 @@ void gslc_ElemSetGlow(gslc_tsGui* pGui,gslc_tsElemRef* pElemRef,bool bGlowing)
GSLC_DEBUG2_PRINT_CONST(ERRSTR_NULL,FUNCSTR);
return;
}
// FIXME: Should also check for change in bGlowEn
bool bGlowingOld = gslc_ElemGetGlow(pGui,pElemRef);
gslc_SetElemRefFlag(pGui,pElemRef,GSLC_ELEMREF_GLOWING,(bGlowing)?GSLC_ELEMREF_GLOWING:0);
// Only change glow state if enabled
if (gslc_ElemGetGlowEn(pGui, pElemRef)) {
bool bGlowingOld = gslc_ElemGetGlow(pGui, pElemRef);
gslc_SetElemRefFlag(pGui, pElemRef, GSLC_ELEMREF_GLOWING, (bGlowing) ? GSLC_ELEMREF_GLOWING : 0);

if (bGlowing != bGlowingOld) {
gslc_ElemSetRedraw(pGui,pElemRef,GSLC_REDRAW_INC);
if (bGlowing != bGlowingOld) {
gslc_ElemSetRedraw(pGui, pElemRef, GSLC_REDRAW_INC);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/GUIslice_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// Define current release (X.Y.Z) & build number
// =======================================================================

#define GUISLICE_VER "0.13.0"
#define GUISLICE_VER "0.13.0.3"

#endif // _GUISLICE_VERSION_H_

0 comments on commit 4c37e54

Please sign in to comment.