[libchamplain: 43/45] Add descriptive comments.
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain: 43/45] Add descriptive comments.
- Date: Sun, 14 Aug 2016 12:31:56 +0000 (UTC)
commit dc5e31232a2cbf3c37b13ec0dc9491251d2b310a
Author: Marius Stanciu <stanciumarius94 gmail com>
Date: Tue Aug 9 20:23:29 2016 +0300
Add descriptive comments.
champlain/champlain-path-layer.c | 6 ++++++
champlain/champlain-view.c | 4 ++++
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]