@leafer-ui/worker 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/dist/worker.js CHANGED
@@ -2032,13 +2032,11 @@ var LeaferUI = (function (exports) {
2032
2032
  this.worldTransform = {};
2033
2033
  if (!config)
2034
2034
  config = minSize;
2035
- if (!config.pixelRatio)
2036
- config.pixelRatio = Platform.devicePixelRatio;
2037
2035
  this.manager = manager;
2038
2036
  this.innerId = IncrementId.create(IncrementId.CNAVAS);
2039
2037
  const { width, height, pixelRatio } = config;
2040
2038
  this.autoLayout = !width || !height;
2041
- this.size.pixelRatio = pixelRatio;
2039
+ this.size.pixelRatio = pixelRatio | Platform.devicePixelRatio;
2042
2040
  this.config = config;
2043
2041
  this.init();
2044
2042
  }
@@ -2235,7 +2233,7 @@ var LeaferUI = (function (exports) {
2235
2233
  tempBounds$1.ceil();
2236
2234
  }
2237
2235
  isSameSize(size) {
2238
- return this.width === size.width && this.height === size.height && this.pixelRatio === size.pixelRatio;
2236
+ return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio);
2239
2237
  }
2240
2238
  getSameCanvas(useSameWorldTransform, useSameSmooth) {
2241
2239
  const canvas = this.manager ? this.manager.get(this.size) : Creator.canvas(Object.assign({}, this.size));
@@ -4076,9 +4074,7 @@ var LeaferUI = (function (exports) {
4076
4074
  else if (typeof defaultValue === 'function') {
4077
4075
  property.get = function () {
4078
4076
  let v = this[computedKey];
4079
- if (v === undefined)
4080
- this[computedKey] = v = defaultValue(this.__leaf);
4081
- return v;
4077
+ return v === undefined ? defaultValue(this.__leaf) : v;
4082
4078
  };
4083
4079
  }
4084
4080
  if (key === 'width') {
@@ -6054,7 +6050,7 @@ var LeaferUI = (function (exports) {
6054
6050
  }
6055
6051
  }
6056
6052
 
6057
- const version = "1.5.0";
6053
+ const version = "1.5.1";
6058
6054
 
6059
6055
  class LeaferCanvas extends LeaferCanvasBase {
6060
6056
  get allowBackgroundColor() { return true; }