|
|
|
@ -23,8 +23,13 @@ module.exports = function createObject(options) {
|
|
|
|
|
originY: "top",
|
|
|
|
|
opacity: 1,
|
|
|
|
|
bustCache: function bustCache() {
|
|
|
|
|
this.emit("bustedCache");
|
|
|
|
|
this.isCached = false;
|
|
|
|
|
},
|
|
|
|
|
bustSize: function bustSize() {
|
|
|
|
|
this.emit("bustedSize");
|
|
|
|
|
this.recalculateSize();
|
|
|
|
|
},
|
|
|
|
|
set: function setProperties(properties) {
|
|
|
|
|
let transformedProperties;
|
|
|
|
|
|
|
|
|
@ -37,13 +42,13 @@ module.exports = function createObject(options) {
|
|
|
|
|
Object.assign(this, transformedProperties);
|
|
|
|
|
|
|
|
|
|
if (Object.keys(transformedProperties).some(property => this.sizeBustingProperties.includes(property))) {
|
|
|
|
|
this.emit("bustedSize");
|
|
|
|
|
this.recalculateSize();
|
|
|
|
|
/* If the size changes, the cache should also be implicitly busted. */
|
|
|
|
|
this.bustSize();
|
|
|
|
|
this.bustCache();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Object.keys(transformedProperties).some(property => this.cacheBustingProperties.includes(property))) {
|
|
|
|
|
this.emit("bustedCache");
|
|
|
|
|
this.isCached = false;
|
|
|
|
|
this.bustCache();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
render: function renderObject(context, options = {}) {
|
|
|
|
|