Skip to content

Commit

Permalink
Only need to parse fixed colours just once.
Browse files Browse the repository at this point in the history
Don't need to perform on every viewport configure update.
  • Loading branch information
rnorris committed Jan 18, 2025
1 parent 3e9b923 commit ffc36c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vikviewport.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ vik_viewport_init ( VikViewport *vvp )
*/
//vik_viewport_set_background_color ( vvp, DEFAULT_BACKGROUND_COLOR );
#endif
gdk_color_parse ( "grey", &vvp->scale_bg_color );
gdk_color_parse ( "black", &vvp->black_color );

// Initiate center history
update_centers ( vvp );
Expand Down Expand Up @@ -443,12 +445,10 @@ void configure_common ( VikViewport *vvp )
if ( vvp->scale_bg_gc )
ui_gc_unref ( vvp->scale_bg_gc );
vvp->scale_bg_gc = vik_viewport_new_gc ( vvp, "grey", 3*vvp->scale );
gdk_color_parse ( "grey", &vvp->scale_bg_color );

if ( vvp->black_gc )
ui_gc_unref ( vvp->black_gc );
vvp->black_gc = vik_viewport_new_gc ( vvp, "black", vvp->scale );
gdk_color_parse ( "black", &vvp->black_color );
}

/**
Expand Down

0 comments on commit ffc36c9

Please sign in to comment.