Implement new selection drawing mechanism.

Using the new Item#globalMatrix.
This commit is contained in:
Jürg Lehni 2011-12-20 11:42:00 +01:00
parent 010209c70f
commit 93ede28f3b
4 changed files with 30 additions and 24 deletions
src/project

View file

@ -272,10 +272,13 @@ var Project = this.Project = PaperScopeItem.extend(/** @lends Project# */{
ctx.strokeWidth = 1;
// TODO: use Layer#color
ctx.strokeStyle = ctx.fillStyle = '#009dec';
param = { selection: true };
Base.each(this._selectedItems, function(item) {
item.draw(ctx, param);
});
for (var id in this._selectedItems) {
var item = this._selectedItems[id],
mx = item.getGlobalMatrix();
if (matrix)
mx.preConcatenate(matrix);
item.drawSelected(ctx, mx);
}
ctx.restore();
}
}