Skip to content

Commit e5d94df

Browse files
committed
Fix bug when starting the program with disabled layer boxes
Layers were not being initialized properly
1 parent 9ab957b commit e5d94df

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

scripts/control_draw/control_draw.gml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -788,20 +788,21 @@ starta = draw_scrollbar(scrollbarh, x1, y1 + totalrows * 32 + 34, 32, totalcols
788788
startb = draw_scrollbar(scrollbarv, x1 + totalcols * 32 + 2, y1 + 34, 32, totalrows - 1, endb + totalrows - 1, (exist && changepitch) || mousewheel > 0, 0)
789789

790790
// Draw layers
791-
if (show_layers) {
792-
for (b = 0; b < totalrows; b += 1) {
791+
for (b = 0; b < totalrows; b += 1) {
792+
if (startb + b >= endb2) {
793+
layername[startb + b] = ""
794+
layerlock[startb + b] = 0
795+
layervol[startb + b] = 100
796+
layerstereo[startb + b] = 100
797+
rowamount[startb + b] = 0
798+
endb2 = startb + b + 1
799+
}
800+
if (show_layers) {
793801
x1 = 4
794802
y1 = 54 + 32 + b * 32 - 1
803+
// Name
795804
draw_sprite(spr_layerbox, 0 + (theme = 2), x1, y1)
796-
// Name
797-
if (startb + b >= endb2) {
798-
layername[startb + b] = ""
799-
layerlock[startb + b] = 0
800-
layervol[startb + b] = 100
801-
layerstereo[startb + b] = 100
802-
rowamount[startb + b] = 0
803-
endb2 = startb + b + 1
804-
}
805+
805806
m = mouse_rectangle(x1 + 10, y1 + 10, 75, 13)
806807
popup_set(x1 + 10, y1 + 10, 75, 13, "The name for this layer")
807808
draw_set_font(fnt_small)

0 commit comments

Comments
 (0)