HISE Logo Forum
    • Categories
    • Register
    • Login

    (QoL) Add sendRepaintMessage() to ScriptPanel

    Scheduled Pinned Locked Moved Solved Feature Requests
    5 Posts 3 Posters 373 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.
    • A
      aaronventure
      last edited by

      I'm working on an animation class and I found a silly thing:

      component.get("type") == "ScriptPanel" ? component.repaintImmediately() : component.setRepaintMessage()
      

      I think it would be a good idea to have sendRepaintMessage() for the panel which just does the same thing as the super fast repaintImmediately().

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

        @aaronventure Yes

        Should be very easy to add if you want to get into C++

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

        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @d.healey
          last edited by

          Hmm, the source code says this:

          void ScriptingApi::Content::ScriptPanel::sendRepaintMessage()
          {
          	ScriptComponent::sendRepaintMessage();
          	repaint();
          }
          

          So if you call sendRepaintMessage() with a Panel, it should already call repaint() (which is the exact same thing as repaintImmediately() I think I keep that around for backwards compatibility only).

          Did you really measure a different UI performance between the two calls?

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

            @Christoph-Hart I don't think that's the issue. Aaron wants to be able to use the same function for all components instead of the panel being a special case with its own function name.

            Edit: Looks like it's already there - but not in the API doc

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

            A 1 Reply Last reply Reply Quote 0
            • A
              aaronventure @d.healey
              last edited by

              @d-healey yeah I came about the other way around: I used only repaintImmediately and realized my sliders weren't updating. I didn't think to try sendRepaintMessage for the panel.

              As for the speed, I meant mostly in comparison to sliders and buttons that use LLAF; larger animations are much smoother with the panel and its paint routine.

              1 Reply Last reply Reply Quote 0
              • A aaronventure marked this topic as a question on
              • A aaronventure has marked this topic as solved on
              • First post
                Last post

              11

              Online

              1.8k

              Users

              12.0k

              Topics

              104.8k

              Posts