@effing/canvas 0.24.2 → 0.24.3

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 CHANGED
@@ -3485,10 +3485,8 @@ 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 (wSet && !hSet && typeof style.width === "number" && naturalW > 0) {
3489
- style.height = style.width * (naturalH / naturalW);
3490
- } else if (hSet && !wSet && typeof style.height === "number" && naturalH > 0) {
3491
- style.width = style.height * (naturalW / naturalH);
3488
+ if (naturalW > 0 && naturalH > 0 && !(wSet && hSet)) {
3489
+ yogaNode.setAspectRatio(naturalW / naturalH);
3492
3490
  }
3493
3491
  } catch {
3494
3492
  }