summaryrefslogtreecommitdiff
path: root/champlain
diff options
context:
space:
mode:
authorMarius Stanciu <stanciumarius94@gmail.com>2016-08-09 20:23:29 +0300
committerMarius Stanciu <stanciumarius94@gmail.com>2016-08-09 20:23:29 +0300
commitdc5e31232a2cbf3c37b13ec0dc9491251d2b310a (patch)
treecb41d8adc5ed511d388309ca87ae8dc5683e159a /champlain
parent105a2e89334cb9c0496934606dcb9d0f829e2d43 (diff)
downloadlibchamplain-dc5e31232a2cbf3c37b13ec0dc9491251d2b310a.tar.gz
Add descriptive comments.
Diffstat (limited to 'champlain')
-rw-r--r--champlain/champlain-path-layer.c6
-rw-r--r--champlain/champlain-view.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/champlain/champlain-path-layer.c b/champlain/champlain-path-layer.c
index a6699c1..0872c04 100644
--- a/champlain/champlain-path-layer.c
+++ b/champlain/champlain-path-layer.c
@@ -568,6 +568,12 @@ invalidate_canvas (ChamplainPathLayer *layer)
champlain_view_get_viewport_origin (priv->view, &viewport_x, &viewport_y);
champlain_view_get_viewport_anchor (priv->view, &anchor_x, &anchor_y);
+ /* For efficiency in terms of clipping, the path actors must have a minimal size.
+ * The right_actor renders the paths on the visible side of the original map layer
+ * (from viewport offset to end of the map).
+ * The left_actor renders the paths on the visible side of the first cloned map layer
+ * (from the leftmost point on the map, clamped by the viewport width).
+ */
right_actor_width = MIN (map_width - (viewport_x + anchor_x), (gint)view_width);
right_actor_height = MIN (map_height - (viewport_y + anchor_y), (gint)view_height);
left_actor_width = MIN (view_width - right_actor_width, map_width - right_actor_width);
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 62c79ee..63ac2bb 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -425,6 +425,10 @@ view_relocated_cb (G_GNUC_UNUSED ChamplainViewport *viewport,
row_count = champlain_map_source_get_row_count (priv->map_source, priv->zoom_level);
champlain_viewport_get_anchor (CHAMPLAIN_VIEWPORT (priv->viewport), &anchor_x, &anchor_y);
+ /* The area containing tiles in the map layer is actually column_count * tile_size wide (same
+ * for height), but the viewport anchor acts as an offset for the tile actors, causing the map
+ * layer to contain some empty space as well.
+ */
new_width = column_count * tile_size + anchor_x;
new_height = row_count * tile_size + anchor_y;