Define settings.applyMatrix and inherit at Item creation time.

This commit is contained in:
Jürg Lehni 2014-03-04 09:30:04 +01:00
parent 7dbf6ceaff
commit d594b4264d
2 changed files with 5 additions and 0 deletions

View file

@ -49,6 +49,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
paper = this;
// Default configurable settings.
this.settings = {
applyMatrix: true,
handleSize: 4,
hitTolerance: 0
};
@ -89,6 +90,8 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
/**
* Gives access to paper's configurable settings.
*
* <b>settings.applyMatrix:</b>
*
* <b>settings.handleSize:</b>
*
* <b>settings.hitTolerance:</b>

View file

@ -96,6 +96,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
project = paper.project;
if (!internal)
this._id = Item._id = (Item._id || 0) + 1;
// Inherit the applyMatrix setting from paper.settings.applyMatrix
this._applyMatrix = this._canApplyMatrix && paper.settings.applyMatrix;
// Handle matrix before everything else, to avoid issues with
// #addChild() calling _changed() and accessing _matrix already.
if (point)