(QoL) Add sendRepaintMessage() to ScriptPanel
-
I'm working on an animation class and I found a silly thing:
component.get("type") == "ScriptPanel" ? component.repaintImmediately() : component.setRepaintMessage()
I think it would be a good idea to have sendRepaintMessage() for the panel which just does the same thing as the super fast repaintImmediately().
-
@aaronventure Yes
Should be very easy to add if you want to get into C++
-
Hmm, the source code says this:
void ScriptingApi::Content::ScriptPanel::sendRepaintMessage() { ScriptComponent::sendRepaintMessage(); repaint(); }
So if you call
sendRepaintMessage()
with a Panel, it should already callrepaint()
(which is the exact same thing asrepaintImmediately()
I think I keep that around for backwards compatibility only).Did you really measure a different UI performance between the two calls?
-
@Christoph-Hart I don't think that's the issue. Aaron wants to be able to use the same function for all components instead of the panel being a special case with its own function name.
Edit: Looks like it's already there - but not in the API doc
-
@d-healey yeah I came about the other way around: I used only repaintImmediately and realized my sliders weren't updating. I didn't think to try sendRepaintMessage for the panel.
As for the speed, I meant mostly in comparison to sliders and buttons that use LLAF; larger animations are much smoother with the panel and its paint routine.
-
-