mirror of
https://github.com/konvajs/konva.git
synced 2026-01-09 11:34:38 +08:00
fix "same value" detection in setAttr. fix #378
This commit is contained in:
@@ -1879,7 +1879,8 @@
|
||||
_setAttr: function(key, val) {
|
||||
var oldVal;
|
||||
oldVal = this.attrs[key];
|
||||
if (oldVal === val) {
|
||||
var same = oldVal === val;
|
||||
if (same && !Konva.Util.isObject(val)) {
|
||||
return;
|
||||
}
|
||||
if (val === undefined || val === null) {
|
||||
|
||||
@@ -107,7 +107,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Transform constructor
|
||||
* Transform constructor. Transform object is a private class of Konva framework.
|
||||
* In most of the cases you don't need to use it in your app.
|
||||
* But there is a documentation for that class in case you still want
|
||||
* to make some manual calculations.
|
||||
* @constructor
|
||||
* @param {Array} [m] Optional six-element matrix
|
||||
* @memberof Konva
|
||||
@@ -487,6 +490,10 @@
|
||||
_isString: function(obj) {
|
||||
return Object.prototype.toString.call(obj) === OBJECT_STRING;
|
||||
},
|
||||
// arrays are objects too
|
||||
isObject: function(val) {
|
||||
return val instanceof Object;
|
||||
},
|
||||
isValidSelector: function(selector) {
|
||||
if (typeof selector !== 'string') {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user