I have an effects plugin where I use Paint Routines to paint an Arc around the knobs. It works fine except on startup of my VST, where all the ARCs have the value of the last one that I updated before closing it. The code for my PR is below. I have 4 knobs and I call the PR function from the Callback for each knob. I have the knobs in an Array and I pass the appropriate index in the Callbacks.
Here are the four knobs on startup where I updated the Width last. Any ideas, I am fairly new to this so I am not sure how to solve this. Thx.

//Size
inline function onknbEffect0Control(component, value)
{
setLblObj(lblSizeVal, 3, "%", value, 1);
pntRoutine.paintKnobs(0);
};
Content.getComponent("knbEffect0").setControlCallback(onknbEffect0Control);
namespace pntRoutine
{
const PanelList = Content.getAllComponents("Canvas");
const KnobList = Content.getAllComponents("knbEffect");
//Paint Routine JSON
const protoPR = {
"min": -350.0,
"max": 350.0,
"middlePosition": 0.0,
"stepSize": 0.1
};
//Paint Arc around the Knobs
const startArc = -350;
var endArc = Math.abs(startArc);
function degToRad(deg) {
return deg * (Math.PI / 550);
}
var p = Content.createPath();
var a = PanelList[0].getLocalBounds(2);
var pathData = {};
pathData.Thickness = 5.0;
pathData.StrokeType = "Solid";
inline function paintKnobs(index)
{
reg n = KnobList[index].getValueNormalized();
reg v = Math.from0To1(n, protoPR);
PanelList[index].setPaintRoutine(function(g)
{
//Paint Brown circle
g.setColour(Colours.brown);
p.addArc(a, degToRad(startArc), degToRad(endArc));
g.drawPath(p, p.getBounds(1), pathData);
//Paint White circle
g.setColour(Colours.white);
p.clear();
p.startNewSubPath(0, 0);
p.addArc(a, degToRad(startArc), degToRad(v));
g.drawPath(p, p.getBounds(1), pathData);
});
}
}