From 2e265693ff63bb78b3fe2c57c6ebc216fdbf2ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 18 Apr 2013 17:50:53 -0700 Subject: [PATCH] Make #drawSelected() protected. --- src/path/Path.js | 2 +- src/project/Project.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index 5e905dc7..a57884be 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1876,7 +1876,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ } }, - drawSelected: function(ctx, matrix) { + _drawSelected: function(ctx, matrix) { ctx.beginPath(); drawSegments(ctx, this, matrix); // Now stroke it and draw its handles: diff --git a/src/project/Project.js b/src/project/Project.js index 68cfe9a1..6ac1cf65 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -313,15 +313,17 @@ var Project = this.Project = PaperScopeItem.extend(/** @lends Project# */{ for (var id in this._selectedItems) { var item = this._selectedItems[id]; if (item._drawCount === this._drawCount - && (item.drawSelected || item._boundsSelected)) { + && (item._drawSelected || item._boundsSelected)) { var mx = item._globalMatrix; - if (item.drawSelected) - item.drawSelected(ctx, mx); + if (item._drawSelected) + item._drawSelected(ctx, mx); if (item._boundsSelected) { // We need to call the internal _getBounds, to get non- // transformed bounds. var coords = mx._transformCorners( item._getBounds('getBounds')); + // Now draw a rectangle that connects the transformed + // bounds corners, and draw the corners. ctx.beginPath(); for (var i = 0; i < 8; i++) ctx[i === 0 ? 'moveTo' : 'lineTo'](