Forum

    • Register
    • Login
    • Search
    • Categories

    childPanel painting issue

    Bug Reports
    4
    13
    124
    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.
    • ustk
      ustk last edited by ustk

      @Christoph-Hart This drove me crazy for hours until I found this might be a bug...

      In this example, a childPanel has a child at its right with the same alpha value as the reference rectangle at the left.
      We can see that the children seem to be painted twice, as the resulting alpha don't look the same...
      This also causes the font to be emphasized

      HiseSnippet 1420.3ocsX0uaaaCDmJMpswaoXcXO.D4uj67bkS+Z.EEyN1IqFKI0HNqc.EEELRzVDQlTPhNtFEA6UYOZ6QXuAaGo9h1V1KHEU8Op4c7t62c7tiGyfXgGMIQDir1474QTj02ZObNWFzMfv3n98PVOv9DRhjFiSIcv7HRRB0GYYcmeUQvZmsQ5u+4WNfDR3dzRRHzaELO5wrILYI0As+MVX3QDe54rIF69os66I3cEgho.dtisKJh3cIYL8ThZaaYirt6g9LoHdnjHoIHqsOP3OeXfXFOc+ukkvtHjpVzBMDTTJ4iDg9JDqnh5FvB8Gj62IHPKCJiB2IMJ7C1mv7YEzKiFemlAtTBy3g0VaBdsLgm6MGdVFva6T38P6gdwrHYIGE19F69b3fZDANBLgU5dQa8m22tq.1AW1bB4R5QwvhBIbdtqaC7ybcq+xcqo9GbTjHwWQhwS.me.OD+Jbt3ioxthIQBNrvYuL96ojDq+LkNjA+3U32+gWtHUN80T13.Eum4psYldZlPAkFnYtWCiclhrG+XbGeebrX1t0XbEW7nobOISvwBNw2+LwrCjbETiEgNd43rAX2voz56V6yovjMB6jSRs9y4nGiyrAA6oNMJoGJ7HgoDAXmiWvlomZDNMzoLJnhC4+RKixyFHRXJr5.Qa1iJctFEpCBtui4KCbpuryuI0BBKOSLUBB3jGObFWubqFtm5abyQPQXmvPmzBtjlyBXRpoYVzTYwkioij3X5HZLEJ0WVmIpDCk5J0JSFzILJfTP4hPnptA1s4Spur0RA0YTO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HL3P88FVVGxIPVlNiD8e5kdoh.
      

      I cannot help pressing F5 in the forum...
      Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

      1 Reply Last reply Reply Quote 0
      • S
        Steve Mohican last edited by Steve Mohican

        When you choose a color tone that you want with 1.0 alpha value, I think it shouldn't look like this, even the children painted twice.

        ustk 2 Replies Last reply Reply Quote 0
        • ustk
          ustk @Steve Mohican last edited by

          @Steve-Mohican I agree but this means something's going wrong in the back anyway

          I cannot help pressing F5 in the forum...
          Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

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

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

            I cannot help pressing F5 in the forum...
            Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

            1 Reply Last reply Reply Quote 0
            • ustk
              ustk @Steve Mohican last edited by

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

              I cannot help pressing F5 in the forum...
              Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

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

                @Christoph-Hart Any insight on this?

                I cannot help pressing F5 in the forum...
                Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                1 Reply Last reply Reply Quote 0
                • d.healey
                  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

                  ustk 1 Reply Last reply Reply Quote 1
                  • ustk
                    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 😉

                    I cannot help pressing F5 in the forum...
                    Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                    1 Reply Last reply Reply Quote 0
                    • Christoph Hart
                      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

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

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

                        I cannot help pressing F5 in the forum...
                        Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                        1 Reply Last reply Reply Quote 0
                        • Christoph Hart
                          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.

                          https://github.com/christophhart/HISE/commit/010fa4f29bfc3eebeac89c1054aa74b3b7b02ccb

                          ustk 1 Reply Last reply Reply Quote 1
                          • ustk
                            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?

                            I cannot help pressing F5 in the forum...
                            Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                            1 Reply Last reply Reply Quote 0
                            • Christoph Hart
                              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

                              13
                              Online

                              977
                              Users

                              6.6k
                              Topics

                              60.5k
                              Posts