mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Introduce Item flag to selectively activate on stroke-scaling on classes that support it.
Closes #721
This commit is contained in:
parent
1563f69ce9
commit
978aaf9f3b
3 changed files with 5 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -21,6 +21,7 @@ var Shape = Item.extend(/** @lends Shape# */{
|
|||
_class: 'Shape',
|
||||
_applyMatrix: false,
|
||||
_canApplyMatrix: false,
|
||||
_canScaleStroke: true,
|
||||
_boundsSelected: true,
|
||||
_serializeFields: {
|
||||
type: null,
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
var PathItem = Item.extend(/** @lends PathItem# */{
|
||||
_class: 'PathItem',
|
||||
_canScaleStroke: true,
|
||||
|
||||
initialize: function PathItem() {
|
||||
// Do nothing.
|
||||
|
|
Loading…
Reference in a new issue