[libchamplain] Fix the previous commit by adjusting offset based on the viewport size
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Fix the previous commit by adjusting offset based on the viewport size
- Date: Tue, 7 May 2013 23:56:14 +0000 (UTC)
commit ce564e0cff5199c9b9ba66a2f05db94d5911c791
Author: Jiří Techet <techet gmail com>
Date: Wed May 8 01:56:01 2013 +0200
Fix the previous commit by adjusting offset based on the viewport size
champlain/champlain-view.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 3bf7979..450bf2e 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2512,8 +2512,8 @@ view_set_zoom_level_at (ChamplainView *view,
/* priv->viewport_x, priv->viewport_y are in int which isn't sufficient precision
* when multiplied by deltazoom - recalculate them */
- viewport_x = champlain_map_source_get_x (priv->map_source, priv->zoom_level, priv->longitude);
- viewport_y = champlain_map_source_get_y (priv->map_source, priv->zoom_level, priv->latitude);
+ viewport_x = champlain_map_source_get_x (priv->map_source, priv->zoom_level, priv->longitude) -
priv->viewport_width / 2.0;
+ viewport_y = champlain_map_source_get_y (priv->map_source, priv->zoom_level, priv->latitude) -
priv->viewport_height / 2.0;
new_x = (viewport_x + offset_x) * deltazoom - offset_x;
new_y = (viewport_y + offset_y) * deltazoom - offset_y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]