Commit 327cabb7 authored by James Westman's avatar James Westman Committed by Corentin Noël
Browse files

scale: Update when the reference map source changes

Previously, if you set the scale's viewport before you set the
viewport's reference map source, the scale would start out at 1ft/1m.
parent f5d84563
Pipeline #264610 passed with stage
in 2 minutes and 18 seconds
......@@ -212,22 +212,14 @@ shumate_scale_on_scale_changed (ShumateScale *self)
}
static void
on_latitude_changed (ShumateScale *self,
G_GNUC_UNUSED GParamSpec *pspec,
ShumateViewport *viewport)
on_viewport_props_changed (ShumateScale *self,
G_GNUC_UNUSED GParamSpec *pspec,
ShumateViewport *viewport)
{
shumate_scale_on_scale_changed (self);
}
static void
on_zoom_level_changed (ShumateScale *self,
G_GNUC_UNUSED GParamSpec *pspec,
ShumateViewport *viewport)
{
shumate_scale_on_scale_changed (self);
}
static void
shumate_scale_get_property (GObject *object,
guint prop_id,
......@@ -477,8 +469,9 @@ shumate_scale_set_viewport (ShumateScale *scale,
g_object_notify_by_pspec(G_OBJECT (scale), obj_properties[PROP_VIEWPORT]);
if (scale->viewport)
{
g_signal_connect_swapped (scale->viewport, "notify::latitude", G_CALLBACK (on_latitude_changed), scale);
g_signal_connect_swapped (scale->viewport, "notify::zoom-level", G_CALLBACK (on_zoom_level_changed), scale);
g_signal_connect_swapped (scale->viewport, "notify::latitude", G_CALLBACK (on_viewport_props_changed), scale);
g_signal_connect_swapped (scale->viewport, "notify::zoom-level", G_CALLBACK (on_viewport_props_changed), scale);
g_signal_connect_swapped (scale->viewport, "notify::reference-map-source", G_CALLBACK (on_viewport_props_changed), scale);
}
shumate_scale_on_scale_changed (scale);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment