@effing/canvas 0.24.2 → 0.24.4
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/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3485,10 +3485,13 @@ async function buildNode(element, parentStyle, yogaNode, viewportWidth, viewport
|
|
|
3485
3485
|
const naturalH = image.height;
|
|
3486
3486
|
const wSet = style.width !== void 0;
|
|
3487
3487
|
const hSet = style.height !== void 0;
|
|
3488
|
-
if (
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3488
|
+
if (naturalW > 0 && naturalH > 0) {
|
|
3489
|
+
if (!wSet && !hSet) {
|
|
3490
|
+
style.width = naturalW;
|
|
3491
|
+
style.height = naturalH;
|
|
3492
|
+
} else if (!(wSet && hSet)) {
|
|
3493
|
+
yogaNode.setAspectRatio(naturalW / naturalH);
|
|
3494
|
+
}
|
|
3492
3495
|
}
|
|
3493
3496
|
} catch {
|
|
3494
3497
|
}
|