HISE Logo Forum
    • Categories
    • Register
    • Login

    Look and feel drawing help

    Scheduled Pinned Locked Moved Scripting
    lookandfeelsliderhelp
    1 Posts 1 Posters 19 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.
    • E
      eokeefee
      last edited by

      I am trying to make a vertical slider show a circle where the value is. I have the following code:

      const laf = Engine.createGlobalScriptLookAndFeel();
      
      laf.registerFunction("drawLinearSlider", function(g, obj)
      {
          obj.drawOutside = true;
      
          var a = obj.area;
          var norm = obj.valueNormalized;
      
          var cx = a[0] + (a[2] / 2);
          var cy = a[1] + a[3] * (1.0 - norm);
      
          var radius = 15;
      
          g.setColour(obj.itemColour1);
          g.fillEllipse([cx - radius, cy - radius, radius * 2, radius * 2]);
      });
      

      This is working great, however the circle clips when it reaches the top
      Screenshot_1.jpg (The red is the circle).

      Is there a way to stop the clipping? I think it's something to do with the bounds of the slider, but I'm not sure...

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

      40

      Online

      2.1k

      Users

      12.9k

      Topics

      112.0k

      Posts