HISE Logo Forum
    • Categories
    • Register
    • Login

    childPanel painting issue

    Scheduled Pinned Locked Moved Bug Reports
    13 Posts 4 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk
      last edited by

      I updated the snippet above for a clearer demonstration...

      Can't help pressing F5 in the forum...

      1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @A Former User
        last edited by

        @Steve-Mohican And this doesn't fix the font glitch (aliasing) when a text is painted twice

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • ustkU
          ustk
          last edited by

          @Christoph-Hart Any insight on this?

          Can't help pressing F5 in the forum...

          1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey
            last edited by

            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");
                });
            }
            

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            ustkU 1 Reply Last reply Reply Quote 1
            • ustkU
              ustk @d.healey
              last edited by

              @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 ;)

              Can't help pressing F5 in the forum...

              1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart
                last edited by

                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

                ustkU 1 Reply Last reply Reply Quote 0
                • ustkU
                  ustk @Christoph Hart
                  last edited by

                  @Christoph-Hart Yep, I tried, opaque doesn't help...

                  Can't help pressing F5 in the forum...

                  1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart
                    last edited by

                    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.

                    Link Preview Image
                    - fix anonymous child panels being added twice 路 christophhart/HISE@010fa4f

                    The open source framework for sample based instruments - - fix anonymous child panels being added twice 路 christophhart/HISE@010fa4f

                    favicon

                    GitHub (github.com)

                    ustkU 1 Reply Last reply Reply Quote 1
                    • ustkU
                      ustk @Christoph Hart
                      last edited by

                      @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-example

                      Thanks a lot!

                      Noticed the last math APIs... What the difference between Math.wrap and Math.range? Is that more adapted for signals?

                      Can't help pressing F5 in the forum...

                      1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        Fmod behaves weird for negative values so for any kind of looping wrap is better.

                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post

                        26

                        Online

                        1.8k

                        Users

                        12.0k

                        Topics

                        104.4k

                        Posts