Explain the booolean argument in color getter calls, and put _matrix in local variable for better minification.

This commit is contained in:
Jürg Lehni 2013-05-13 19:31:41 -07:00
parent 7c2e57e105
commit ae416f821c

View file

@ -2234,19 +2234,22 @@ var Item = this.Item = Base.extend(Callback, {
// transformation state is stored.
// Pass on the transformation to the content, and apply it there too,
// 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
// color styles with matrices (only gradients so far):
var style = this._style,
// pass true for dontMerge so we don't recursively transform
// styles on groups' children.
fillColor = style.getFillColor(true),
strokeColor = style.getStrokeColor(true);
if (fillColor)
fillColor.transform(this._matrix);
fillColor.transform(matrix);
if (strokeColor)
strokeColor.transform(this._matrix);
strokeColor.transform(matrix);
// Reset the internal matrix to the identity transformation if it
// was possible to apply it.
this._matrix.reset();
matrix.reset();
}
if (!_dontNotify)
this._changed(/*#=*/ Change.GEOMETRY);