From 0410aae841fc0834861123f95ddeb8bd93db2ce6 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Wed, 4 May 2016 22:44:30 +0200 Subject: [PATCH] Control customization part 2 - Allow for separate corner filling and cornerStroke (#2933) --- src/mixins/object_interactivity.mixin.js | 8 ++++++-- src/shapes/object.class.js | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mixins/object_interactivity.mixin.js b/src/mixins/object_interactivity.mixin.js index 994d8447af9..e2d2224ffab 100644 --- a/src/mixins/object_interactivity.mixin.js +++ b/src/mixins/object_interactivity.mixin.js @@ -289,9 +289,10 @@ methodName = this.transparentCorners ? 'strokeRect' : 'fillRect'; ctx.save(); - - ctx.lineWidth = 1; ctx.strokeStyle = ctx.fillStyle = this.cornerColor; + if (!this.transparentCorners) { + ctx.strokeStyle = this.cornerStrokeColor; + } this._setLineDash(ctx, this.cornerDashArray, null); // top-left @@ -359,6 +360,9 @@ var size = this.cornerSize; isVML() || this.transparentCorners || ctx.clearRect(left, top, size, size); ctx[methodName](left, top, size, size); + if (!this.transparentCorners && this.cornerStrokeColor) { + ctx.strokeRect(left, top, size, size); + } }, /** diff --git a/src/shapes/object.class.js b/src/shapes/object.class.js index 2154c0ab9a3..4c1d69ab95c 100644 --- a/src/shapes/object.class.js +++ b/src/shapes/object.class.js @@ -455,6 +455,14 @@ */ cornerColor: 'rgba(102,153,255,0.5)', + /** + * Color of controlling corners of an object (when it's active and transparentCorners false) + * @since 1.6.2 + * @type String + * @default + */ + cornerStrokeColor: null, + /** * Array specifying dash pattern of an object's control (hasBorder must be true) * @since 1.6.2