Skip to content

Commit e53ab81

Browse files
committed
[ap draw] fix segfault when disp is off
skip set_initial_world when no display
1 parent 0cd7c88 commit e53ab81

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vpr/src/draw/draw.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
290290
* value controls whether or not the Proceed button must be clicked to *
291291
* continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */
292292
t_draw_state* draw_state = get_draw_state_vars();
293-
293+
294294
strcpy(draw_state->default_message, msg);
295295

296296
if (!draw_state->show_graphics)
@@ -306,10 +306,12 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
306306

307307
state_change = true;
308308

309-
if (pic_on_screen_val == ANALYTICAL_PLACEMENT) {
310-
set_initial_world_ap();
311-
} else {
312-
set_initial_world();
309+
if (draw_state->show_graphics) {
310+
if (pic_on_screen_val == ANALYTICAL_PLACEMENT) {
311+
set_initial_world_ap();
312+
} else {
313+
set_initial_world();
314+
}
313315
}
314316

315317
if (draw_state->pic_on_screen == NO_PICTURE) {

0 commit comments

Comments
 (0)