wyreframe 0.7.7 → 0.7.8
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/package.json
CHANGED
|
@@ -19,7 +19,7 @@ function calculate(content, position, boxBounds) {
|
|
|
19
19
|
return "Left";
|
|
20
20
|
} else if (rightRatio < 0.2 && leftRatio > 0.3) {
|
|
21
21
|
return "Right";
|
|
22
|
-
} else if (Math.abs(leftRatio - rightRatio) < 0.
|
|
22
|
+
} else if (Math.abs(leftRatio - rightRatio) < 0.2) {
|
|
23
23
|
return "Center";
|
|
24
24
|
} else {
|
|
25
25
|
return "Left";
|
|
@@ -52,9 +52,11 @@ let calculate = (
|
|
|
52
52
|
let rightRatio = Int.toFloat(rightSpace) /. Int.toFloat(boxWidth)
|
|
53
53
|
|
|
54
54
|
// Thresholds for alignment detection
|
|
55
|
+
// Note: centerTolerance increased from 0.15 to 0.2 to be more lenient
|
|
56
|
+
// This fixes issue #22 where visually centered buttons were detected as Left
|
|
55
57
|
let leftThreshold = 0.2
|
|
56
58
|
let rightThreshold = 0.2
|
|
57
|
-
let centerTolerance = 0.
|
|
59
|
+
let centerTolerance = 0.2
|
|
58
60
|
|
|
59
61
|
// Apply alignment rules
|
|
60
62
|
if leftRatio < leftThreshold && rightRatio > 0.3 {
|