Skip to content

Commit 7f6933a

Browse files
committed
[ap draw] fix segfault when disp is off
skip set_initial_world when no display
1 parent dc6e76a commit 7f6933a

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
@@ -285,7 +285,7 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
285285
* value controls whether or not the Proceed button must be clicked to *
286286
* continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */
287287
t_draw_state* draw_state = get_draw_state_vars();
288-
288+
289289
strcpy(draw_state->default_message, msg);
290290

291291
if (!draw_state->show_graphics)
@@ -301,10 +301,12 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
301301

302302
state_change = true;
303303

304-
if (pic_on_screen_val == ANALYTICAL_PLACEMENT) {
305-
set_initial_world_ap();
306-
} else {
307-
set_initial_world();
304+
if (draw_state->show_graphics) {
305+
if (pic_on_screen_val == ANALYTICAL_PLACEMENT) {
306+
set_initial_world_ap();
307+
} else {
308+
set_initial_world();
309+
}
308310
}
309311

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

0 commit comments

Comments
 (0)