diff --git a/src/util/shape/Chain.js b/src/util/shape/Chain.js index 821f8fbc3c..49ec61efa4 100644 --- a/src/util/shape/Chain.js +++ b/src/util/shape/Chain.js @@ -19,6 +19,7 @@ define(function (require) { Chain.prototype = { type : 'chain', + /** * 画刷 * @param ctx 画布句柄 diff --git a/src/util/shape/Chord.js b/src/util/shape/Chord.js index 41501c8dea..674e92cd42 100644 --- a/src/util/shape/Chord.js +++ b/src/util/shape/Chord.js @@ -43,6 +43,7 @@ define(function (require) { ChordShape.prototype = { type : 'chord', + // center, source0, source1, target0, target1, r buildPath : function (ctx, style) { var PI2 = Math.PI * 2; diff --git a/src/util/shape/Cross.js b/src/util/shape/Cross.js index 181ea8e82e..0ea0946323 100644 --- a/src/util/shape/Cross.js +++ b/src/util/shape/Cross.js @@ -40,6 +40,7 @@ define(function (require) { Cross.prototype = { type : 'cross', + /** * 创建矩形路径 * @param {Context2D} ctx Canvas 2D上下文 @@ -55,7 +56,6 @@ define(function (require) { style.yStart = rect.y; style.yEnd = rect.y + rect.height; LineShape.prototype.buildPath(ctx, style); - return; }, /** @@ -70,16 +70,10 @@ define(function (require) { // 快速预判并保留判断矩形 var rect = this.style.__rect = this.style.__rect || this.getRect(this.style); - if (x >= rect.x + return x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return true; - } - - return false; + && y <= (rect.y + rect.height); } };