Skip to content

Instantly share code, notes, and snippets.

@GoodBoyNinja
Last active November 17, 2023 22:28
Show Gist options
  • Save GoodBoyNinja/442fd1a57003d1b968ae68da2fafabee to your computer and use it in GitHub Desktop.
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.
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