@sepveneto/free-dom 0.11.4 → 0.11.5

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.css CHANGED
@@ -1,4 +1,4 @@
1
- /* ../../../../../../../tmp/tmp-1904-Fhi89l99xkzO/core/src/style/index.css */
1
+ /* ../../../../../../../tmp/tmp-1997-wxCDj8wK2ZXD/core/src/style/index.css */
2
2
  :root {
3
3
  --vv-free-dom--theme: rgb(64, 137, 239);
4
4
  --vv-free-dom--line: var(--vv-free-dom--theme);
package/dist/index.js CHANGED
@@ -1594,16 +1594,17 @@ var resizeDomCore = (0, import_vue_demi16.defineComponent)({
1594
1594
  return [width, height];
1595
1595
  if (lockAspectRatio) {
1596
1596
  const ratio = props.width / props.height;
1597
- const deltaW = width - props.width;
1598
- const deltaH = height - props.height;
1599
- if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
1600
- height = width / ratio;
1601
- } else {
1597
+ if (ratio > 1) {
1598
+ height = Math.max(height, props.minHeight);
1602
1599
  width = height * ratio;
1600
+ } else {
1601
+ width = Math.max(width, props.minWidth);
1602
+ height = width / ratio;
1603
1603
  }
1604
+ } else {
1605
+ width = Math.max(width, props.minWidth);
1606
+ height = Math.max(height, props.minHeight);
1604
1607
  }
1605
- width = Math.max(width, props.minWidth);
1606
- height = Math.max(height, props.minHeight);
1607
1608
  return [width, height];
1608
1609
  }
1609
1610
  function handleResize(handleName, axis) {
package/dist/index.mjs CHANGED
@@ -1573,16 +1573,17 @@ var resizeDomCore = defineComponent4({
1573
1573
  return [width, height];
1574
1574
  if (lockAspectRatio) {
1575
1575
  const ratio = props.width / props.height;
1576
- const deltaW = width - props.width;
1577
- const deltaH = height - props.height;
1578
- if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
1579
- height = width / ratio;
1580
- } else {
1576
+ if (ratio > 1) {
1577
+ height = Math.max(height, props.minHeight);
1581
1578
  width = height * ratio;
1579
+ } else {
1580
+ width = Math.max(width, props.minWidth);
1581
+ height = width / ratio;
1582
1582
  }
1583
+ } else {
1584
+ width = Math.max(width, props.minWidth);
1585
+ height = Math.max(height, props.minHeight);
1583
1586
  }
1584
- width = Math.max(width, props.minWidth);
1585
- height = Math.max(height, props.minHeight);
1586
1587
  return [width, height];
1587
1588
  }
1588
1589
  function handleResize(handleName, axis) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sepveneto/free-dom",
3
- "version": "0.11.4",
3
+ "version": "0.11.5",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",