mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Use _dontMerge for #getSelectedColor() on both item and layer, and have style getters on item pass on _dontMerge to the style object.
This commit is contained in:
parent
bd07305435
commit
fce31599a5
2 changed files with 7 additions and 7 deletions
|
@ -3697,7 +3697,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
&& (this._drawSelected || this._boundsSelected)) {
|
&& (this._drawSelected || this._boundsSelected)) {
|
||||||
// Allow definition of selected color on a per item and per
|
// Allow definition of selected color on a per item and per
|
||||||
// layer level, with a fallback to #009dec
|
// layer level, with a fallback to #009dec
|
||||||
var color = this.getSelectedColor()
|
var color = this.getSelectedColor(true)
|
||||||
|| this.getLayer().getSelectedColor(true),
|
|| this.getLayer().getSelectedColor(true),
|
||||||
mx = matrix.clone().concatenate(this.getGlobalMatrix(true));
|
mx = matrix.clone().concatenate(this.getGlobalMatrix(true));
|
||||||
ctx.strokeStyle = ctx.fillStyle = color
|
ctx.strokeStyle = ctx.fillStyle = color
|
||||||
|
|
|
@ -110,15 +110,15 @@ var Style = Base.extend(new function() {
|
||||||
justification: /*#=*/ Change.GEOMETRY
|
justification: /*#=*/ Change.GEOMETRY
|
||||||
};
|
};
|
||||||
|
|
||||||
var item = {},
|
// Enforce creation of beans, as bean getters have hidden parameters,
|
||||||
|
// see _dontMerge argument below.
|
||||||
|
var item = { beans: true },
|
||||||
fields = {
|
fields = {
|
||||||
_defaults: defaults,
|
_defaults: defaults,
|
||||||
// Override default fillColor for text items
|
// Override default fillColor for text items
|
||||||
_textDefaults: new Base(defaults, {
|
_textDefaults: new Base(defaults, {
|
||||||
fillColor: new Color() // black
|
fillColor: new Color() // black
|
||||||
}),
|
}),
|
||||||
// Enforce creation of beans, as bean getters have hidden parameters
|
|
||||||
// See _dontMerge argument below.
|
|
||||||
beans: true
|
beans: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ var Style = Base.extend(new function() {
|
||||||
// - Style values are all stored in this._values
|
// - Style values are all stored in this._values
|
||||||
// - The style object starts with an empty _values object, with fallback
|
// - The style object starts with an empty _values object, with fallback
|
||||||
// on _defaults through code in the getter below.
|
// on _defaults through code in the getter below.
|
||||||
// - Only the styles that are explicitely set on the object get defined
|
// - Only the styles that are explicitly set on the object get defined
|
||||||
// in _values.
|
// in _values.
|
||||||
// - Color values are not stored as converted colors immediately. The
|
// - Color values are not stored as converted colors immediately. The
|
||||||
// raw value is stored, and conversion only happens in the getter.
|
// raw value is stored, and conversion only happens in the getter.
|
||||||
|
@ -211,8 +211,8 @@ var Style = Base.extend(new function() {
|
||||||
|
|
||||||
// Inject style getters and setters into the Item class, which redirect
|
// Inject style getters and setters into the Item class, which redirect
|
||||||
// calls to the linked style object.
|
// calls to the linked style object.
|
||||||
item[get] = function() {
|
item[get] = function(_dontMerge) {
|
||||||
return this._style[get]();
|
return this._style[get](_dontMerge);
|
||||||
};
|
};
|
||||||
|
|
||||||
item[set] = function(value) {
|
item[set] = function(value) {
|
||||||
|
|
Loading…
Reference in a new issue