Look and feel drawing help
-
I am trying to make a vertical slider show a circle where the value is. I have the following code:
const laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawLinearSlider", function(g, obj) { obj.drawOutside = true; var a = obj.area; var norm = obj.valueNormalized; var cx = a[0] + (a[2] / 2); var cy = a[1] + a[3] * (1.0 - norm); var radius = 15; g.setColour(obj.itemColour1); g.fillEllipse([cx - radius, cy - radius, radius * 2, radius * 2]); });This is working great, however the circle clips when it reaches the top
(The red is the circle).Is there a way to stop the clipping? I think it's something to do with the bounds of the slider, but I'm not sure...