diff --git a/src/item/Item.js b/src/item/Item.js index 5cb7861a..cdf1d3e2 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -2851,22 +2851,6 @@ var Item = this.Item = Base.extend(Callback, { // Return the temporary context, so it can be reused CanvasProvider.release(ctx); } - }, - - statics: { - drawSelectedBounds: function(bounds, ctx, matrix) { - var coords = matrix._transformCorners(bounds); - ctx.beginPath(); - for (var i = 0; i < 8; i++) - ctx[i == 0 ? 'moveTo' : 'lineTo'](coords[i], coords[++i]); - ctx.closePath(); - ctx.stroke(); - for (var i = 0; i < 8; i++) { - ctx.beginPath(); - ctx.rect(coords[i] - 2, coords[++i] - 2, 4, 4); - ctx.fill(); - } - } } }, Base.each(['down', 'drag', 'up', 'move'], function(name) { this['removeOn' + Base.capitalize(name)] = function() { diff --git a/src/project/Project.js b/src/project/Project.js index 607c00b4..68cfe9a1 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -317,11 +317,23 @@ var Project = this.Project = PaperScopeItem.extend(/** @lends Project# */{ var mx = item._globalMatrix; if (item.drawSelected) item.drawSelected(ctx, mx); - if (item._boundsSelected) + if (item._boundsSelected) { // We need to call the internal _getBounds, to get non- // transformed bounds. - Item.drawSelectedBounds(item._getBounds('getBounds'), - ctx, mx); + var coords = mx._transformCorners( + item._getBounds('getBounds')); + ctx.beginPath(); + for (var i = 0; i < 8; i++) + ctx[i === 0 ? 'moveTo' : 'lineTo']( + coords[i], coords[++i]); + ctx.closePath(); + ctx.stroke(); + for (var i = 0; i < 8; i++) { + ctx.beginPath(); + ctx.rect(coords[i] - 2, coords[++i] - 2, 4, 4); + ctx.fill(); + } + } } } ctx.restore();