Fit the Waveform LAF inside an ellipse
-
I would like to fit the shape of the waveform with the drawn ellipse, can anyone help me with my trigonometry homework?
// WAVEFORM LAF - Global LAF for waveforms const LAF = Engine.createGlobalScriptLookAndFeel(); // Current Playback Position LAF.registerFunction("drawThumbnailRuler", function(g, obj) { g.setColour(0x60FFFFFF); var x = obj.xPosition; g.drawLine(x, x, 0, obj.area[3], 2.0); }); LAF.registerFunction("drawThumbnailRange", function(g, obj) { var a = obj.area; g.setColour(Colours.antiquewhite); // Draw an ellipse instead of a rounded rectangle g.drawEllipse([a[0] + 2, a[1] + 1, a[2] - 3, a[3] - 2], 2); }); LAF.registerFunction("drawThumbnailText", function(g, obj) { g.setColour(Colours.white); g.setFont("Oxygen", 12.0); g.drawAlignedText(obj.text, [310, 5, 70, 15], "right"); }); LAF.registerFunction("drawThumbnailPath", function(g, obj) { var a = obj.area; g.setGradientFill([0x80762EFF, a[0], a[1], 0xFF2EFFE9, a[2], a[3]]); g.fillPath(obj.path, obj.area); });
-
-
@Mighty23 Just made that post https://forum.hise.audio/topic/10292/paint-routine-rounded-image/4
That should put you on the track -
@ustk Thanks for pointing me in the right direction; I'll do some testing.