|
40 | 40 | import javafx.scene.layout.Priority; |
41 | 41 | import javafx.scene.layout.Region; |
42 | 42 | import javafx.scene.layout.VBox; |
43 | | -import javafx.stage.DirectoryChooser; |
44 | | -import javafx.stage.Modality; |
45 | | -import javafx.stage.Stage; |
46 | | -import javafx.stage.StageStyle; |
| 43 | +import javafx.stage.*; |
47 | 44 |
|
48 | 45 | /** |
49 | 46 | * Project creation wizard for VN projects. |
@@ -1089,7 +1086,7 @@ private void updatePresetPreview() { |
1089 | 1086 | if (lblPreview == null || cmbTheme == null || cmbResolution == null) return; |
1090 | 1087 | String name = txtProjectName == null ? "" : txtProjectName.getText().trim(); |
1091 | 1088 | if (name.isBlank()) name = "Untitled"; |
1092 | | - int[] resolution = parseResolution(); |
| 1089 | + int[] resolution = getScaledResolution(); |
1093 | 1090 | String res = resolution[0] + "x" + resolution[1]; |
1094 | 1091 | String ratio = formatAspectRatio(resolution[0], resolution[1]); |
1095 | 1092 | String theme = cmbTheme.getValue() == null ? "Dark Elegant" : cmbTheme.getValue(); |
@@ -1544,7 +1541,7 @@ private void createProjectStructure(File dir, String displayName) throws Excepti |
1544 | 1541 | } |
1545 | 1542 | } |
1546 | 1543 |
|
1547 | | - int[] resolution = parseResolution(); |
| 1544 | + int[] resolution = getScaledResolution(); |
1548 | 1545 | createManifest( |
1549 | 1546 | dir, |
1550 | 1547 | displayName, |
@@ -1768,6 +1765,16 @@ private int[] parseResolution() { |
1768 | 1765 | return new int[] {width, height}; |
1769 | 1766 | } |
1770 | 1767 |
|
| 1768 | + private int[] getScaledResolution() { |
| 1769 | + int[] resolution = parseResolution(); |
| 1770 | + double scaling = Screen.getPrimary().getOutputScaleX(); |
| 1771 | + |
| 1772 | + int width = (int) (resolution[0] / scaling); |
| 1773 | + int height = (int) (resolution[1] / scaling); |
| 1774 | + |
| 1775 | + return new int[] {width, height}; |
| 1776 | + } |
| 1777 | + |
1771 | 1778 | private int parseDimension(String raw, int fallback, String axis) { |
1772 | 1779 | if (raw == null || raw.isBlank()) return fallback; |
1773 | 1780 | try { |
@@ -2229,7 +2236,7 @@ private void createSettings(File dir) throws Exception { |
2229 | 2236 | } |
2230 | 2237 |
|
2231 | 2238 | private void createDialogueLayout(File dir) throws Exception { |
2232 | | - int[] res = parseResolution(); |
| 2239 | + int[] res = getScaledResolution(); |
2233 | 2240 | double scale = res[1] / 1080.0; |
2234 | 2241 | String template = LayoutDslTemplates.defaultDialogueLayoutTemplate(); |
2235 | 2242 | if (Math.abs(scale - 1.0) > 0.01) { |
@@ -2664,7 +2671,7 @@ private void createReadme(File dir, |
2664 | 2671 | fw.write("- Initial commit: " + (gitInitialCommit ? "yes" : "no") + "\n\n"); |
2665 | 2672 |
|
2666 | 2673 | fw.write("## Runtime Profile\n\n"); |
2667 | | - int[] resolution = parseResolution(); |
| 2674 | + int[] resolution = getScaledResolution(); |
2668 | 2675 | fw.write("- Resolution: " + resolution[0] + "x" + resolution[1] + " (" + formatAspectRatio(resolution[0], resolution[1]) + ")\n"); |
2669 | 2676 | fw.write("- Theme preset: " + (cmbTheme.getValue() == null ? "Dark Elegant" : cmbTheme.getValue()) + "\n"); |
2670 | 2677 | fw.write("- UI backend: " + (cmbRuntimeUi.getValue() == null ? "fx" : cmbRuntimeUi.getValue()) + "\n"); |
|
0 commit comments