If for now you have the same code as the one in LookAndFeelV3, the line you want to change is :
filledArc.addPieSegment (rx, ry, rw, rw, rotaryStartAngle, angle, thickness);
you just have do draw from the center instead of rotaryStartAngle. something like :
const float centerAngle = rotaryStartAngle + 0.5f * (rotaryEndAngle - rotaryStartAngle);
Path filledArc;
filledArc.addPieSegment (rx, ry, rw, rw, centerAngle, angle, thickness);
g.fillPath (filledArc);
I’d like to avoid doing another subclass of my look and feel. Is there anywhere I can hide a draw from centre flag in the slider?
That would mean subclassing the slider. you better subclass your lnf then I think.
Otherwise, if you want to do it just for a single slider or so, and don’t mind being a bit hacky you could still just check its name.
Another thing you could also consider (but that’s a particular behaviour) is setting the DoubleClickReturnValue of your sliders, and then drawing from there :
const double dbclkVal = slider.getDoubleClickReturnValue();
const float dbclkValPos = (float) slider.valueToProportionOfLength (dbclkVal);
const float dbclkValAngle = rotaryStartAngle + dbclkValPos * (rotaryEndAngle - rotaryStartAngle);
Path filledArc;
filledArc.addPieSegment (rx, ry, rw, rw, dbclkValAngle, angle, thickness);
g.fillPath (filledArc);