[gnumeric] Fix control points behavior when zooming.



commit 8d6979a0581da3d9df778444525fb280e08e6f15
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Aug 11 15:16:07 2010 +0200

    Fix control points behavior when zooming.

 ChangeLog      |    5 +++++
 NEWS           |    3 ++-
 src/gnm-pane.c |    8 ++++++--
 3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9b2bea3..4acdc00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-11  Jean Brefort  <jean brefort normalesup org>
+
+	* src/gnm-pane.c (cb_update_ctrl_pts), (set_item_x_y),
+	(set_acetate_coords): make control points zoom correctly. [see #626404]
+
 2010-08-10  Jean Brefort  <jean brefort normalesup org>
 
 	* src/gnm-pane-impl.h: update comment.
diff --git a/NEWS b/NEWS
index fe08063..6961b16 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,8 @@ Jean:
 	* Force column span recalculation when switching between number and
 	  error. [#625994]
 	* Fix scroll when selecting a merged cell. [#626065]
-	* Fix objecs dragging when zoomed. [#626484]
+	* Fix objects dragging when zoomed. [#626484]
+	* Fix control points behavior when zooming.
 
 Morten:
 	* Survive malformed xml files.
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 174461a..681f024 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -2061,6 +2061,9 @@ gnm_pane_size_guide_motion (GnmPane *pane, gboolean vert, gint64 guide_pos)
 static void
 cb_update_ctrl_pts (SheetObject *so, GocItem **ctrl_pts, GnmPane *pane)
 {
+	double *coords = g_hash_table_lookup (
+		pane->simple.scg->selected_objects, so);
+	scg_object_anchor_to_coords (pane->simple.scg, sheet_object_get_anchor (so), coords);
 	gnm_pane_object_update_bbox (pane, so);
 }
 
@@ -2857,7 +2860,8 @@ set_item_x_y (GnmPane *pane, SheetObject *so, GocItem **ctrl_pts,
 	if (ctrl_pts [idx] == NULL)
 		ctrl_pts [idx] = new_control_point (pane, so, idx, x / scale, y / scale, CTRL_PT_SIZE / scale);
 	else
-		goc_item_set (ctrl_pts [idx], "x", x / scale, "y", y / scale, NULL);
+		goc_item_set (ctrl_pts [idx], "x", x / scale, "y", y / scale,
+		              "radius", CTRL_PT_SIZE / scale, NULL);
 	if (visible)
 		goc_item_show (ctrl_pts [idx]);
 	else
@@ -2881,7 +2885,7 @@ set_acetate_coords (GnmPane *pane, SheetObject *so, GocItem **ctrl_pts,
 			style->fill.auto_fore = FALSE;
 			style->fill.pattern.fore = 0;
 			style->line.pattern = GO_PATTERN_THIN_DIAG;
-			style->line.width = 1.;
+			style->line.width = 0.;
 			style->line.auto_color = FALSE;
 			style->line.color = 0;
 			style->line.fore = GO_COLOR_BLACK;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]