浏览代码

Prevent drawCircle from drawing a triangle (#326)

Nacho Verdón 7 年之前
父节点
当前提交
1e59ddc7e4
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 ) {