mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-09 14:22:08 -05:00
Explain the booolean argument in color getter calls, and put _matrix in local variable for better minification.
This commit is contained in:
parent
7c2e57e105
commit
ae416f821c
1 changed files with 7 additions and 4 deletions
|
@ -2234,19 +2234,22 @@ var Item = this.Item = Base.extend(Callback, {
|
||||||
// transformation state is stored.
|
// transformation state is stored.
|
||||||
// Pass on the transformation to the content, and apply it there too,
|
// Pass on the transformation to the content, and apply it there too,
|
||||||
// by passing true for the 2nd hidden parameter.
|
// by passing true for the 2nd hidden parameter.
|
||||||
if (this._transformContent(this._matrix, true)) {
|
var matrix = this._matrix;
|
||||||
|
if (this._transformContent(matrix, true)) {
|
||||||
// When the matrix could be applied, we also need to transform
|
// When the matrix could be applied, we also need to transform
|
||||||
// color styles with matrices (only gradients so far):
|
// color styles with matrices (only gradients so far):
|
||||||
var style = this._style,
|
var style = this._style,
|
||||||
|
// pass true for dontMerge so we don't recursively transform
|
||||||
|
// styles on groups' children.
|
||||||
fillColor = style.getFillColor(true),
|
fillColor = style.getFillColor(true),
|
||||||
strokeColor = style.getStrokeColor(true);
|
strokeColor = style.getStrokeColor(true);
|
||||||
if (fillColor)
|
if (fillColor)
|
||||||
fillColor.transform(this._matrix);
|
fillColor.transform(matrix);
|
||||||
if (strokeColor)
|
if (strokeColor)
|
||||||
strokeColor.transform(this._matrix);
|
strokeColor.transform(matrix);
|
||||||
// Reset the internal matrix to the identity transformation if it
|
// Reset the internal matrix to the identity transformation if it
|
||||||
// was possible to apply it.
|
// was possible to apply it.
|
||||||
this._matrix.reset();
|
matrix.reset();
|
||||||
}
|
}
|
||||||
if (!_dontNotify)
|
if (!_dontNotify)
|
||||||
this._changed(/*#=*/ Change.GEOMETRY);
|
this._changed(/*#=*/ Change.GEOMETRY);
|
||||||
|
|
Loading…
Reference in a new issue