childPanel painting issue
-
@Steve-Mohican I agree but this means something's going wrong in the back anyway
-
I updated the snippet above for a clearer demonstration...
-
@Steve-Mohican And this doesn't fix the font glitch (aliasing) when a text is painted twice
-
@Christoph-Hart Any insight on this?
-
I found a solution/workaround for you
inline function addAlphaPanelToChild(p) { local panel = p.addChildPanel(); p.data.btn = panel; panel.setPosition(110, 5, 70, 40); panel.setPaintRoutine(function(g) { g.fillAll(Colours.white); // <<< I added this line g.setColour(Colours.withAlpha(Colours.black, 0.3)); g.fillRect([0, 0, 70, 20]); g.setColour(Colours.black); g.drawAlignedText("CHILD", [0, 20, 70, 20], "centred"); }); }
-
@d-healey Thank you Dave for this workaround. Effectively when it is painted for the second time it acts as a mask.
This works but we still have to keep in mind an operation is done for nothing if painted twice.
I'll use your workaround for now ;) -
Have you played around with the
opaque
property? There are some glitches if you set it to true and then fill it with a (semi-)transparent background -
@Christoph-Hart Yep, I tried,
opaque
doesn't help... -
Wow, that was super annoying to fix, but it somehow added the child panel twice when you click the button.
BTW, I noticed you're using an external array to keep a reference to the panel. This is not recommended as there is already a list that you can query with this function.
https://github.com/christophhart/HISE/commit/010fa4f29bfc3eebeac89c1054aa74b3b7b02ccb
-
@Christoph-Hart Annoying? 7 lines of code?
The list I use is from the example in the documentation. This should be updated then...
https://docs.hise.audio/tutorials/recipes/ui/scriptpanel.html#horizontal-list-exampleThanks a lot!
Noticed the last math APIs... What the difference between Math.wrap and Math.range? Is that more adapted for signals?
-
Fmod behaves weird for negative values so for any kind of looping wrap is better.