Skip to content

Commit

Permalink
Arc and sectors radius < 0 bug fix,Fix apache/echarts#2431
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 18, 2016
1 parent 08855cd commit 50bc271
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/graphic/shape/Arc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

var x = shape.cx;
var y = shape.cy;
var r = shape.r;
var r = Math.max(shape.r, 0);
var startAngle = shape.startAngle;
var endAngle = shape.endAngle;
var clockwise = shape.clockwise;
Expand Down
8 changes: 4 additions & 4 deletions src/graphic/shape/Sector.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ define(function (require) {

buildPath: function (ctx, shape) {

var x = shape.cx; // 圆心x
var y = shape.cy; // 圆心y
var r0 = shape.r0 || 0; // 形内半径[0,r)
var r = shape.r; // 扇形外半径(0,r]
var x = shape.cx;
var y = shape.cy;
var r0 = Math.max(shape.r0 || 0, 0);
var r = Math.max(shape.r, 0);
var startAngle = shape.startAngle;
var endAngle = shape.endAngle;
var clockwise = shape.clockwise;
Expand Down

0 comments on commit 50bc271

Please sign in to comment.