Make #drawSelected() protected.

This commit is contained in:
Jürg Lehni 2013-04-18 17:50:53 -07:00
parent 517b2ee27f
commit 2e265693ff
2 changed files with 6 additions and 4 deletions

View file

@ -1876,7 +1876,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
} }
}, },
drawSelected: function(ctx, matrix) { _drawSelected: function(ctx, matrix) {
ctx.beginPath(); ctx.beginPath();
drawSegments(ctx, this, matrix); drawSegments(ctx, this, matrix);
// Now stroke it and draw its handles: // Now stroke it and draw its handles:

View file

@ -313,15 +313,17 @@ var Project = this.Project = PaperScopeItem.extend(/** @lends Project# */{
for (var id in this._selectedItems) { for (var id in this._selectedItems) {
var item = this._selectedItems[id]; var item = this._selectedItems[id];
if (item._drawCount === this._drawCount if (item._drawCount === this._drawCount
&& (item.drawSelected || item._boundsSelected)) { && (item._drawSelected || item._boundsSelected)) {
var mx = item._globalMatrix; var mx = item._globalMatrix;
if (item.drawSelected) if (item._drawSelected)
item.drawSelected(ctx, mx); item._drawSelected(ctx, mx);
if (item._boundsSelected) { if (item._boundsSelected) {
// We need to call the internal _getBounds, to get non- // We need to call the internal _getBounds, to get non-
// transformed bounds. // transformed bounds.
var coords = mx._transformCorners( var coords = mx._transformCorners(
item._getBounds('getBounds')); item._getBounds('getBounds'));
// Now draw a rectangle that connects the transformed
// bounds corners, and draw the corners.
ctx.beginPath(); ctx.beginPath();
for (var i = 0; i < 8; i++) for (var i = 0; i < 8; i++)
ctx[i === 0 ? 'moveTo' : 'lineTo']( ctx[i === 0 ? 'moveTo' : 'lineTo'](