From f3524ed0e25fc8ecca40dcc9dff3029b88a1bd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 17 Mar 2014 15:17:39 +0100 Subject: [PATCH] Only draw selection if global matrix was calculated for the item. --- src/project/Project.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/project/Project.js b/src/project/Project.js index ebf64dc6..80645a4d 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -451,17 +451,19 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{ ctx.strokeWidth = 1; for (var id in this._selectedItems) { var item = this._selectedItems[id], + globalMatrix = item._globalMatrix, size = this._scope.settings.handleSize; half = size / 2; if (item._updateVersion === this._updateVersion - && (item._drawSelected || item._boundsSelected)) { + && (item._drawSelected || item._boundsSelected) + && globalMatrix) { // Allow definition of selected color on a per item and per // layer level, with a fallback to #009dec var color = item.getSelectedColor() || item.getLayer().getSelectedColor(); ctx.strokeStyle = ctx.fillStyle = color ? color.toCanvasStyle(ctx) : '#009dec'; - var mx = matrix.clone().concatenate(item._globalMatrix); + var mx = matrix.clone().concatenate(globalMatrix); if (item._drawSelected) item._drawSelected(ctx, mx); if (item._boundsSelected) {