Forum
    • Categories
    • Register
    • Login

    Drawing an Arc problem...

    Scheduled Pinned Locked Moved Scripting
    1 Posts 1 Posters 4 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.
    • B
      bwoogie
      last edited by

      I'm having a problem when trying to draw an arc. anything below about 160 degrees starts getting squashed and wonky. Need some help with figuring out what i'm doing wrong here....

      function drawArc() {
      var a = [0, 0, 64, 64];
      var p = Content.createPath();
      p.startNewSubPath(0, 0);
      		    
      p.addArc(a, degToRad(0), degToRad(160));
      		
      var pathData = {};
      pathData.Thickness = 2.0;
      pathData.StrokeType = "Solid";
      		
      g.setColour(accentColor);
      g.drawPath(p, a, pathData);
      }
      
      function degToRad(deg) {
      	return deg * (Math.PI / 180);
      }
      

      45 Degrees:
      772e4c6b-c9da-4ec4-8d5b-cf9fa2759594-image.png

      160 Degrees:
      0a8bd366-0802-46b5-b375-d0482f9f4023-image.png

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

      19

      Online

      2.1k

      Users

      13.0k

      Topics

      112.5k

      Posts