Last active
November 17, 2023 22:28
-
-
Save GoodBoyNinja/442fd1a57003d1b968ae68da2fafabee to your computer and use it in GitHub Desktop.
If you are drawing something to a group or a panel using an onDraw() function, you can use this function to refresh the graphics of this panel on demand.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function RefreshPanel(panelObj) { | |
try { | |
if (!panelObj) { | |
// no panel or group passed to function | |
return false; | |
} | |
if (!panelObj.size) { | |
// size property of the panelObj wasn't found? | |
return false; | |
} | |
var s = panelObj.size; | |
panelObj.size = [s[0], s[1] + 1]; | |
panelObj.size = [s[0], s[1]]; | |
} catch (e) { | |
// something went wrong, you could print or alert an error here | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment