[gnumeric] Fixed autofilter (and other) combos position. [#621817]



commit 734a1afc9a4aa5935f7fa90da925ab0687a1ea03
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Jun 17 13:43:22 2010 +0200

    Fixed autofilter (and other) combos position. [#621817]

 NEWS                                      |    3 +++
 src/widgets/ChangeLog                     |    7 +++++++
 src/widgets/gnm-filter-combo-view.c       |    6 ++++--
 src/widgets/gnm-sheet-slicer-combo-view.c |    6 ++++--
 src/widgets/gnm-validation-combo-view.c   |    6 ++++--
 5 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/NEWS b/NEWS
index 4bcbbf4..803d9c1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.10.7
 
+Jean:
+	* Fixed autofilter (and other) combos position. [#621817]
+
 --------------------------------------------------------------------------
 Gnumeric 1.10.6
 
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index 805bdcc..d2f0a63 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-17  Jean Brefort  <jean brefort normalesup org>
+
+	* gnm-filter-combo-view.c (filter_view_set_bounds): fixed item position
+	when zoom is not 100% upon creation. [#621817]
+	* gnm-sheet-slicer-combo-view.c (sscombo_set_bounds): ditto.
+	* gnm-validation-combo-view.c (vcombo_set_bounds): ditto.
+
 2010-06-17  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* gnumeric-expr-entry.c (gee_check_tooltip): don't create tooltip
diff --git a/src/widgets/gnm-filter-combo-view.c b/src/widgets/gnm-filter-combo-view.c
index 50281c5..f92f89c 100644
--- a/src/widgets/gnm-filter-combo-view.c
+++ b/src/widgets/gnm-filter-combo-view.c
@@ -324,13 +324,15 @@ filter_view_set_bounds (SheetObjectView *sov, double const *coords, gboolean vis
 	GocGroup *view = GOC_GROUP (sov);
 
 	if (visible) {
+		double scale = goc_canvas_get_pixels_per_unit (GOC_ITEM (view)->canvas);
 		double h = (coords[3] - coords[1]) + 1.;
 		if (h > 20.)	/* clip vertically */
 			h = 20.;
+		h /= scale;
 		goc_item_set (GOC_ITEM (view->children->data),
 			/* put it inside the cell */
-			"x",	  ((coords[2] >= 0.) ? (coords[2]-h+1) : coords[0]),
-			"y",	  coords [3] - h + 1.,
+			"x",	  ((coords[2] >= 0.) ? (coords[2] / scale - h + 1) : coords[0] / scale),
+			"y",	  coords [3] / scale - h + 1.,
 			"width",  h,	/* force a square, use h for width too */
 			"height", h,
 			NULL);
diff --git a/src/widgets/gnm-sheet-slicer-combo-view.c b/src/widgets/gnm-sheet-slicer-combo-view.c
index dc43618..4c2042b 100644
--- a/src/widgets/gnm-sheet-slicer-combo-view.c
+++ b/src/widgets/gnm-sheet-slicer-combo-view.c
@@ -163,13 +163,15 @@ sscombo_set_bounds (SheetObjectView *sov, double const *coords, gboolean visible
 	GocGroup *view = GOC_GROUP (sov);
 
 	if (visible) {
+		double scale = goc_canvas_get_pixels_per_unit (GOC_ITEM (view)->canvas);
 		double h = (coords[3] - coords[1]) + 1.;
 		if (h > 20.)	/* clip vertically */
 			h = 20.;
+		h /= scale;
 		goc_item_set (GOC_ITEM (view->children->data),
 			/* put it outside the cell */
-			"x",	  ((coords[2] >= 0.) ? coords[2] : (coords[0]-h+1.)),
-			"y",	  coords [3] - h + 1.,
+			"x",	  ((coords[2] >= 0.) ? coords[2] / scale : (coords[0] / scale - h + 1.)),
+			"y",	  coords [3] / scale - h + 1.,
 			"width",  h,	/* force a square, use h for width too */
 			"height", h,
 			NULL);
diff --git a/src/widgets/gnm-validation-combo-view.c b/src/widgets/gnm-validation-combo-view.c
index db5f897..90f40e2 100644
--- a/src/widgets/gnm-validation-combo-view.c
+++ b/src/widgets/gnm-validation-combo-view.c
@@ -189,13 +189,15 @@ vcombo_set_bounds (SheetObjectView *sov, double const *coords, gboolean visible)
 	GocGroup *view = GOC_GROUP (sov);
 
 	if (visible) {
+		double scale = goc_canvas_get_pixels_per_unit (GOC_ITEM (view)->canvas);
 		double h = (coords[3] - coords[1]) + 1.;
 		if (h > 20.)	/* clip vertically */
 			h = 20.;
+		h /= scale;
 		goc_item_set (GOC_ITEM (view->children->data),
 			/* put it outside the cell */
-			"x",	  ((coords[2] >= 0.) ? coords[2] : (coords[0]-h+1.)),
-			"y",	  coords [3] - h + 1.,
+			"x",	  ((coords[2] >= 0.)? coords[2] / scale: (coords[0] / scale - h + 1.)),
+			"y",	  coords [3] / scale - h + 1.,
 			"width",  h,	/* force a square, use h for width too */
 			"height", h,
 			NULL);



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