fix: auto-switch orientation from square to landscape for non-1:1 ratios

This commit is contained in:
Your Name
2026-01-20 12:47:36 +07:00
parent 96fff453ac
commit 56b7eb0468
2 changed files with 11 additions and 4 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

+11 -4
View File
@@ -52,10 +52,17 @@ app.registerExtension({
console.log("PixelForge: updateResolutions called with:", { aspect, orientation, div, maxMp });
// Auto-select "square" orientation for 1:1 aspect ratio
if (aspect === "1:1" && orientationWidget && orientation !== "square") {
orientationWidget.value = "square";
console.log("PixelForge: Auto-selected square orientation for 1:1 ratio");
// Auto-adjust orientation based on aspect ratio
if (orientationWidget) {
if (aspect === "1:1" && orientation !== "square") {
// For 1:1, force square orientation
orientationWidget.value = "square";
console.log("PixelForge: Auto-selected square orientation for 1:1 ratio");
} else if (aspect !== "1:1" && orientation === "square") {
// For non-1:1 ratios, if currently square, switch to landscape
orientationWidget.value = "landscape";
console.log("PixelForge: Auto-switched from square to landscape for non-1:1 ratio");
}
}
const ratio = ASPECT_RATIOS[aspect];