I have a strange Problem in my plugin. I have two images for my Background (same Image one of them is a copy of the other which is just desaturate.
So i have a simple bool variable, in my paint function i check this variable. If it’s true paint Image A if not paint Image B. Pretty simple.
So but now here is my problem.
If the value is changed, the background is not repainted complete. So behind my component’s (slider and buttons) i can see the other background everywhere else is the old image.
If i move the plugin window outside the monitor and back the Plugin is total repaint and looks good.
So this is what i tried:
Detect that the value was toggled, if yes make a g.fillAll(Colours::white);
Didn’t helped
Detect that the value was toggled, if yes make a Clear Image and paint it first
Ok, but if it doesn’t paint the whole thing, just the sub components, but it does paint successfully when you move it outside the screen (i.e. the OS calls paint), then I would say, it is not called. There is no reason IMHO, why it should paint sometimes or sometimes something else…
I am afraid, there is another bug then in your code…
Maybe put a DBG in your paint() call and double check, if it is really really called…
Aright i just added a repaint() in my PluginEditor::timercallback, now it’s painting perfectly.
actually this kills my cpu but now i get a full repaint and i can check how to get it perfomance. Thank you
Some more Questions to understand my Error:
My PluginProcessorEditor::paint function get called i think every 1-3 seconds (without a repaint call from my side).
Is that normal or i’m doing something wrong?
You can add the check in your timer callback as simple as
if (value != oldValue) {
oldValue = value;
repaint(); // maybe limit to repaint (Rectangle<int> ( 0, 0, 100, 100)); or whatever piece you want to repaint
}
I haven’t observed that, but it can also come from the OS or anything, that invalidates the view… another window moving over it, etc…
But every 1-3 seconds shouldn’t be much of a problem…?