Introduce Item flag to selectively activate on stroke-scaling on classes that support it.

Closes #721
This commit is contained in:
Jürg Lehni 2016-01-15 09:56:10 +01:00
parent 1563f69ce9
commit 978aaf9f3b
3 changed files with 5 additions and 1 deletions

View file

@ -49,6 +49,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
// Exceptions are Raster, PlacedSymbol, Clip and Shape.
_applyMatrix: true,
_canApplyMatrix: true,
_canScaleStroke: false,
_boundsSelected: false,
_selectChildren: false,
// Provide information about fields to be serialized, with their defaults
@ -3981,7 +3982,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
var strokeMatrix = parentStrokeMatrix
? parentStrokeMatrix.chain(matrix)
// pass `true` for dontMerge
: !this.getStrokeScaling(true) && getViewMatrix(globalMatrix),
: this._canScaleStroke && !this.getStrokeScaling(true)
&& getViewMatrix(globalMatrix),
// If we're drawing into a separate canvas and a clipItem is defined
// for the current rendering loop, we need to draw the clip item
// again.

View file

@ -21,6 +21,7 @@ var Shape = Item.extend(/** @lends Shape# */{
_class: 'Shape',
_applyMatrix: false,
_canApplyMatrix: false,
_canScaleStroke: true,
_boundsSelected: true,
_serializeFields: {
type: null,

View file

@ -21,6 +21,7 @@
*/
var PathItem = Item.extend(/** @lends PathItem# */{
_class: 'PathItem',
_canScaleStroke: true,
initialize: function PathItem() {
// Do nothing.