leafer-ui 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/README.md +4 -4
- package/dist/web.cjs +2 -2
- package/dist/web.cjs.map +1 -1
- package/dist/web.esm.js +2 -2
- package/dist/web.esm.js.map +1 -1
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +6 -10
- package/dist/web.js.map +1 -1
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +6 -10
- package/dist/web.module.js.map +1 -1
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/web.module.js
CHANGED
|
@@ -2029,13 +2029,11 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2029
2029
|
this.worldTransform = {};
|
|
2030
2030
|
if (!config)
|
|
2031
2031
|
config = minSize;
|
|
2032
|
-
if (!config.pixelRatio)
|
|
2033
|
-
config.pixelRatio = Platform.devicePixelRatio;
|
|
2034
2032
|
this.manager = manager;
|
|
2035
2033
|
this.innerId = IncrementId.create(IncrementId.CNAVAS);
|
|
2036
2034
|
const { width, height, pixelRatio } = config;
|
|
2037
2035
|
this.autoLayout = !width || !height;
|
|
2038
|
-
this.size.pixelRatio = pixelRatio;
|
|
2036
|
+
this.size.pixelRatio = pixelRatio | Platform.devicePixelRatio;
|
|
2039
2037
|
this.config = config;
|
|
2040
2038
|
this.init();
|
|
2041
2039
|
}
|
|
@@ -2232,7 +2230,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2232
2230
|
tempBounds$1.ceil();
|
|
2233
2231
|
}
|
|
2234
2232
|
isSameSize(size) {
|
|
2235
|
-
return this.width === size.width && this.height === size.height && this.pixelRatio === size.pixelRatio;
|
|
2233
|
+
return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio);
|
|
2236
2234
|
}
|
|
2237
2235
|
getSameCanvas(useSameWorldTransform, useSameSmooth) {
|
|
2238
2236
|
const canvas = this.manager ? this.manager.get(this.size) : Creator.canvas(Object.assign({}, this.size));
|
|
@@ -4073,9 +4071,7 @@ function defineDataProcessor(target, key, defaultValue) {
|
|
|
4073
4071
|
else if (typeof defaultValue === 'function') {
|
|
4074
4072
|
property.get = function () {
|
|
4075
4073
|
let v = this[computedKey];
|
|
4076
|
-
|
|
4077
|
-
this[computedKey] = v = defaultValue(this.__leaf);
|
|
4078
|
-
return v;
|
|
4074
|
+
return v === undefined ? defaultValue(this.__leaf) : v;
|
|
4079
4075
|
};
|
|
4080
4076
|
}
|
|
4081
4077
|
if (key === 'width') {
|
|
@@ -6051,7 +6047,7 @@ class LeafLevelList {
|
|
|
6051
6047
|
}
|
|
6052
6048
|
}
|
|
6053
6049
|
|
|
6054
|
-
const version = "1.5.
|
|
6050
|
+
const version = "1.5.1";
|
|
6055
6051
|
|
|
6056
6052
|
const debug$5 = Debug.get('LeaferCanvas');
|
|
6057
6053
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
@@ -6173,7 +6169,7 @@ class LeaferCanvas extends LeaferCanvasBase {
|
|
|
6173
6169
|
else {
|
|
6174
6170
|
window.addEventListener('resize', this.windowListener = () => {
|
|
6175
6171
|
const pixelRatio = Platform.devicePixelRatio;
|
|
6176
|
-
if (this.pixelRatio !== pixelRatio) {
|
|
6172
|
+
if (!this.config.pixelRatio && this.pixelRatio !== pixelRatio) {
|
|
6177
6173
|
const { width, height } = this;
|
|
6178
6174
|
this.emitResize({ width, height, pixelRatio });
|
|
6179
6175
|
}
|
|
@@ -6190,7 +6186,7 @@ class LeaferCanvas extends LeaferCanvasBase {
|
|
|
6190
6186
|
checkAutoBounds(parentSize) {
|
|
6191
6187
|
const view = this.view;
|
|
6192
6188
|
const { x, y, width, height } = this.autoBounds.getBoundsFrom(parentSize);
|
|
6193
|
-
const size = { width, height, pixelRatio: Platform.devicePixelRatio };
|
|
6189
|
+
const size = { width, height, pixelRatio: this.config.pixelRatio ? this.pixelRatio : Platform.devicePixelRatio };
|
|
6194
6190
|
if (!this.isSameSize(size)) {
|
|
6195
6191
|
const { style } = view;
|
|
6196
6192
|
style.marginLeft = x + 'px';
|