@leafer/core 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/core.cjs CHANGED
@@ -2031,13 +2031,11 @@ class LeaferCanvasBase extends Canvas {
2031
2031
  this.worldTransform = {};
2032
2032
  if (!config)
2033
2033
  config = minSize;
2034
- if (!config.pixelRatio)
2035
- config.pixelRatio = Platform.devicePixelRatio;
2036
2034
  this.manager = manager;
2037
2035
  this.innerId = IncrementId.create(IncrementId.CNAVAS);
2038
2036
  const { width, height, pixelRatio } = config;
2039
2037
  this.autoLayout = !width || !height;
2040
- this.size.pixelRatio = pixelRatio;
2038
+ this.size.pixelRatio = pixelRatio | Platform.devicePixelRatio;
2041
2039
  this.config = config;
2042
2040
  this.init();
2043
2041
  }
@@ -2234,7 +2232,7 @@ class LeaferCanvasBase extends Canvas {
2234
2232
  tempBounds.ceil();
2235
2233
  }
2236
2234
  isSameSize(size) {
2237
- return this.width === size.width && this.height === size.height && this.pixelRatio === size.pixelRatio;
2235
+ return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio);
2238
2236
  }
2239
2237
  getSameCanvas(useSameWorldTransform, useSameSmooth) {
2240
2238
  const canvas = this.manager ? this.manager.get(this.size) : Creator.canvas(Object.assign({}, this.size));
@@ -4075,9 +4073,7 @@ function defineDataProcessor(target, key, defaultValue) {
4075
4073
  else if (typeof defaultValue === 'function') {
4076
4074
  property.get = function () {
4077
4075
  let v = this[computedKey];
4078
- if (v === undefined)
4079
- this[computedKey] = v = defaultValue(this.__leaf);
4080
- return v;
4076
+ return v === undefined ? defaultValue(this.__leaf) : v;
4081
4077
  };
4082
4078
  }
4083
4079
  if (key === 'width') {
@@ -6053,7 +6049,7 @@ class LeafLevelList {
6053
6049
  }
6054
6050
  }
6055
6051
 
6056
- const version = "1.5.0";
6052
+ const version = "1.5.1";
6057
6053
 
6058
6054
  exports.AlignHelper = AlignHelper;
6059
6055
  exports.AroundHelper = AroundHelper;