Forum
    • Categories
    • Register
    • Login

    Panel paint routine - different corner radius on same panel?

    Scheduled Pinned Locked Moved General Questions
    11 Posts 3 Posters 80 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.
    • DanHD
      DanH
      last edited by DanH

      Is this possible? I know we can opt to have rounded or non rounded but can we change the radius of each corner? As in each corner a different size

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @DanH
        last edited by

        @DanH Yes I made a video about it :)

        https://youtu.be/hSvoRdSZ-PA

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @David Healey
          last edited by DanH

          @David-Healey Thanks but I don't see what I'm looking for. Each corner a different radius. 10, 6, 4, 2 or something...

          Probably didn't explain the question very well!

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

          David HealeyD 1 Reply Last reply Reply Quote 1
          • David HealeyD
            David Healey @DanH
            last edited by David Healey

            Oh I see what you mean, hmm you'd probably need to use a path for that.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            DanHD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH @David Healey
              last edited by

              @David-Healey yep. Maybe I'll see if Claude can add to source code though...

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

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

                @DanH I've added a function a while back to make asymmetric rounded corners but they all share the same curve.

                Path.addRoundedRectangleCustomisable(var area, var cornerSizeXY, var boolCurves)

                Perhaps a mix between Dave's object and this function could unlock asymmetric curves + different curves per corner + show/hide with boolean

                Hise made me an F5 dude, any other app just suffers...

                David HealeyD 1 Reply Last reply Reply Quote 0
                • David HealeyD
                  David Healey @ustk
                  last edited by

                  @ustk said in Panel paint routine - different corner radius on same panel?:

                  asymmetric rounded corners but they all share the same curve

                  Got an image so I can visualise this?

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

                  ustkU 2 Replies Last reply Reply Quote 0
                  • ustkU
                    ustk @David Healey
                    last edited by

                    @David-Healey
                    Screenshot 2026-03-06 at 15.45.43.png

                    Hise made me an F5 dude, any other app just suffers...

                    David HealeyD 1 Reply Last reply Reply Quote 1
                    • ustkU
                      ustk @David Healey
                      last edited by

                      @David-Healey @DanH but the problem is that it's derived from this Juce path function

                      void Path::addRoundedRectangle (const float x, const float y, const float w, const float h,
                                                      float csx, float csy,
                                                      const bool curveTopLeft, const bool curveTopRight,
                                                      const bool curveBottomLeft, const bool curveBottomRight)
                      

                      where we can see there's only one set of csx and csy

                      so in the end it's easier to make either a specific function in Hise script that reproduces the Juce's one with more customisation, or just import a path...

                      Hise made me an F5 dude, any other app just suffers...

                      1 Reply Last reply Reply Quote 0
                      • David HealeyD
                        David Healey @ustk
                        last edited by

                        @ustk Ah cool. I wonder if it's possible to extend the existing drawRoundedRectangle function to allow for this behaviour and what Dan wants too, through the cornerData object.

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - Public HISE tutorials
                        My Patreon - HISE tutorials

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

                          @David-Healey I'm pretty sure all existing rectangles functions in Hise (or at least the ones with corner data) are ending their lives in this Juce function, with its limitations...

                          
                          void Path::addRoundedRectangle (float x, float y, float w, float h, float cs)
                          {
                              addRoundedRectangle (x, y, w, h, cs, cs);
                          }
                          
                          void Path::addRoundedRectangle (float x, float y, float w, float h, float csx, float csy)
                          {
                              addRoundedRectangle (x, y, w, h, csx, csy, true, true, true, true);
                          }
                          
                          void Path::addRoundedRectangle (const float x, const float y, const float w, const float h,
                                                          float csx, float csy,
                                                          const bool curveTopLeft, const bool curveTopRight,
                                                          const bool curveBottomLeft, const bool curveBottomRight)
                          {
                              csx = jmin (csx, w * 0.5f);
                              csy = jmin (csy, h * 0.5f);
                              auto cs45x = csx * 0.45f;
                              auto cs45y = csy * 0.45f;
                              auto x2 = x + w;
                              auto y2 = y + h;
                          
                              if (curveTopLeft)
                              {
                                  startNewSubPath (x, y + csy);
                                  cubicTo (x, y + cs45y, x + cs45x, y, x + csx, y);
                              }
                              else
                              {
                                  startNewSubPath (x, y);
                              }
                          
                              if (curveTopRight)
                              {
                                  lineTo (x2 - csx, y);
                                  cubicTo (x2 - cs45x, y, x2, y + cs45y, x2, y + csy);
                              }
                              else
                              {
                                  lineTo (x2, y);
                              }
                          
                              if (curveBottomRight)
                              {
                                  lineTo (x2, y2 - csy);
                                  cubicTo (x2, y2 - cs45y, x2 - cs45x, y2, x2 - csx, y2);
                              }
                              else
                              {
                                  lineTo (x2, y2);
                              }
                          
                              if (curveBottomLeft)
                              {
                                  lineTo (x + csx, y2);
                                  cubicTo (x + cs45x, y2, x, y2 - cs45y, x, y2 - csy);
                              }
                              else
                              {
                                  lineTo (x, y2);
                              }
                          
                              closeSubPath();
                          }
                          

                          But it gives a good hint on how to create a more custom one in Hise script

                          Hise made me an F5 dude, any other app just suffers...

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

                          18

                          Online

                          2.2k

                          Users

                          13.5k

                          Topics

                          117.2k

                          Posts