Skip to content

Commit d269267

Browse files
committed
Fix wrong song area height when starting the program with piano disabled
The height was being defined inside the Preferences window, once the 'Show piano' toggle was changed. Moved that to the drawing code, which updates in real time.
1 parent d08ed95 commit d269267

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

scripts/control_draw/control_draw.gml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ if (show_layers) {
7878
} else {
7979
totalcols = floor(rw / 32)
8080
}
81-
if show_piano = 1 {
82-
rhval = 270
81+
rhval = 270
82+
if (!show_piano) {
83+
rhval = 130
8384
}
8485
totalrows = floor((rh - rhval) / 32)
8586
if (min(keysmax, floor((rw - 32) / 39)) != keysshow) {

scripts/draw_window_preferences/draw_window_preferences.gml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,7 @@ if (selected_tab = 0) {
142142
if (draw_checkbox(x1 + 40, y1 + 200, fade, "No fading", "Disables transparency animations on note block sprites")) fade = !fade
143143
if (draw_checkbox(x1 + 40, y1 + 220, show_layers, "Show layer boxes", "Whether the layer boxes should be\nshown to the right of the workspace.")) show_layers = !show_layers
144144
draw_areaheader(x1 + 22, y1 + 260, 456, 95, "Piano")
145-
if (draw_checkbox(x1 + 40, y1 + 276, show_piano, "Show piano", "Whether the piano should be visible.")) {
146-
show_piano=!show_piano
147-
rhval=130
148-
if show_piano = 1 {
149-
rhval=270
150-
}
151-
}
145+
if (draw_checkbox(x1 + 40, y1 + 276, show_piano, "Show piano", "Whether the piano should be visible.")) show_piano = !show_piano
152146
if (draw_checkbox(x1 + 40, y1 + 296, show_keynames, "Show key names", "If the names of the keys should be shown.")) show_keynames=!show_keynames
153147
if (draw_checkbox(x1 + 40, y1 + 316, show_keyboard, "Show keyboard shortcuts", "Show the keyboard shortcuts of the keys.")) show_keyboard=!show_keyboard
154148
if (draw_checkbox(x1 + 40, y1 + 336, show_notechart, "Show note chart when hovering over keys", "Whether to show a note chart\nwhen hovering over the keys.")) show_notechart=!show_notechart

0 commit comments

Comments
 (0)