Commit ad77959
committed
refactor: simplify auto-detect and auto-fit branching logic in ResolutionMasterCanvas
Collapse four overlapping if/else branches into two primary paths plus two
independent follow-up calls. The conditions on autoFitOnChange, autoDetect,
and useCustomCalc were previously cross-multiplied across every combination,
duplicating the same applyAutoFit/setDimensions calls. The new logic:
1. If autoFitOnChange && selectedCategory -> applyAutoFit (unified regardless
of useCustomCalc).
2. Else if autoDetect -> set dimensions directly.
3. autoResizeOnChange and useCustomCalc are handled independently after the
main branch so they still run when applicable.
Also ensures useCustomCalc + selectedCategory triggers handleAutoCalc at the
end, which was previously only reachable through one specific branch.1 parent 7bd7656 commit ad77959
1 file changed
Lines changed: 5 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2658 | 2658 | | |
2659 | 2659 | | |
2660 | 2660 | | |
2661 | | - | |
2662 | | - | |
2663 | | - | |
2664 | | - | |
2665 | | - | |
2666 | | - | |
2667 | | - | |
2668 | | - | |
| 2661 | + | |
2669 | 2662 | | |
2670 | 2663 | | |
2671 | | - | |
2672 | | - | |
2673 | | - | |
2674 | | - | |
2675 | | - | |
2676 | | - | |
2677 | | - | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
2681 | 2664 | | |
2682 | 2665 | | |
2683 | 2666 | | |
2684 | 2667 | | |
2685 | 2668 | | |
| 2669 | + | |
2686 | 2670 | | |
2687 | 2671 | | |
2688 | 2672 | | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
2689 | 2676 | | |
2690 | 2677 | | |
2691 | 2678 | | |
| |||
0 commit comments