mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix exceptions when a top-level layer is selected.
Getting the parent layer on a top-level layer returns null.
This commit is contained in:
parent
c5ec9ae0b9
commit
d9c9b3d1a2
1 changed files with 3 additions and 2 deletions
|
@ -4065,8 +4065,9 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
&& this._isUpdated(updateVersion)) {
|
||||
// Allow definition of selected color on a per item and per
|
||||
// layer level, with a fallback to #009dec
|
||||
var color = this.getSelectedColor(true)
|
||||
|| this.getLayer().getSelectedColor(true),
|
||||
var layer,
|
||||
color = this.getSelectedColor(true)
|
||||
|| (layer = this.getLayer()) && layer.getSelectedColor(true),
|
||||
mx = matrix.chain(this.getGlobalMatrix(true));
|
||||
ctx.strokeStyle = ctx.fillStyle = color
|
||||
? color.toCanvasStyle(ctx) : '#009dec';
|
||||
|
|
Loading…
Reference in a new issue