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:
Jürg Lehni 2014-04-29 19:40:46 +02:00
parent bd07305435
commit fce31599a5
2 changed files with 7 additions and 7 deletions

View file

@ -3697,7 +3697,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
&& (this._drawSelected || this._boundsSelected)) {
// Allow definition of selected color on a per item and per
// layer level, with a fallback to #009dec
var color = this.getSelectedColor()
var color = this.getSelectedColor(true)
|| this.getLayer().getSelectedColor(true),
mx = matrix.clone().concatenate(this.getGlobalMatrix(true));
ctx.strokeStyle = ctx.fillStyle = color

View file

@ -110,15 +110,15 @@ var Style = Base.extend(new function() {
justification: /*#=*/ Change.GEOMETRY
};
var item = {},
// Enforce creation of beans, as bean getters have hidden parameters,
// see _dontMerge argument below.
var item = { beans: true },
fields = {
_defaults: defaults,
// Override default fillColor for text items
_textDefaults: new Base(defaults, {
fillColor: new Color() // black
}),
// Enforce creation of beans, as bean getters have hidden parameters
// See _dontMerge argument below.
beans: true
};
@ -134,7 +134,7 @@ var Style = Base.extend(new function() {
// - Style values are all stored in this._values
// - The style object starts with an empty _values object, with fallback
// 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.
// - Color values are not stored as converted colors immediately. The
// 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
// calls to the linked style object.
item[get] = function() {
return this._style[get]();
item[get] = function(_dontMerge) {
return this._style[get](_dontMerge);
};
item[set] = function(value) {