HISE Logo Forum
    • Categories
    • Register
    • Login

    Fit the Waveform LAF inside an ellipse

    Scheduled Pinned Locked Moved Unsolved General Questions
    3 Posts 2 Posters 171 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.
    • M
      Mighty23
      last edited by

      I would like to fit the shape of the waveform with the drawn ellipse, can anyone help me with my trigonometry homework?
      562af1de-7b10-4cd7-8035-fcec053818f5-image.png

      // WAVEFORM LAF - Global LAF for waveforms
      const LAF = Engine.createGlobalScriptLookAndFeel();
      
      // Current Playback Position
      LAF.registerFunction("drawThumbnailRuler", function(g, obj)
      {
          g.setColour(0x60FFFFFF);
          var x = obj.xPosition;
          g.drawLine(x, x, 0, obj.area[3], 2.0);
      });
      
      LAF.registerFunction("drawThumbnailRange", function(g, obj)
      {
          var a = obj.area;
          g.setColour(Colours.antiquewhite);
          // Draw an ellipse instead of a rounded rectangle
          g.drawEllipse([a[0] + 2, a[1] + 1, a[2] - 3, a[3] - 2], 2);
      });
      
      LAF.registerFunction("drawThumbnailText", function(g, obj)
      {
          g.setColour(Colours.white);
          g.setFont("Oxygen", 12.0);
          g.drawAlignedText(obj.text, [310, 5, 70, 15], "right");
      });
      
      LAF.registerFunction("drawThumbnailPath", function(g, obj)
      {
          var a = obj.area;
          g.setGradientFill([0x80762EFF, a[0], a[1], 0xFF2EFFE9, a[2], a[3]]);
          g.fillPath(obj.path, obj.area);
      });
      

      Free Party, Free Tekno & Free Software too

      ustkU 1 Reply Last reply Reply Quote 0
      • M Mighty23 marked this topic as a question on
      • ustkU
        ustk @Mighty23
        last edited by

        @Mighty23 Just made that post https://forum.hise.audio/topic/10292/paint-routine-rounded-image/4
        That should put you on the track

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

        M 1 Reply Last reply Reply Quote 1
        • M
          Mighty23 @ustk
          last edited by

          @ustk Thanks for pointing me in the right direction; I'll do some testing.

          Free Party, Free Tekno & Free Software too

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

          51

          Online

          1.7k

          Users

          11.7k

          Topics

          102.1k

          Posts