Browse Source

Prevent drawCircle from drawing a triangle (#326)

Nacho Verdón 7 years ago
parent
commit
1e59ddc7e4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h2d/Graphics.hx

+ 1 - 1
h2d/Graphics.hx

@@ -422,7 +422,7 @@ class Graphics extends Drawable {
 	public function drawCircle( cx : Float, cy : Float, ray : Float, nsegments = 0 ) {
 		flush();
 		if( nsegments == 0 )
-			nsegments = Math.ceil(ray * 3.14 * 2 / 4);
+			nsegments = Math.ceil(Math.abs(ray * 3.14 * 2 / 4));
 		if( nsegments < 3 ) nsegments = 3;
 		var angle = Math.PI * 2 / nsegments;
 		for( i in 0...nsegments + 1 ) {