[gnumeric] Fix snap to grid for one cell or basolute anchored objects. [#754792]
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fix snap to grid for one cell or basolute anchored objects. [#754792]
- Date: Fri, 11 Sep 2015 17:43:14 +0000 (UTC)
commit 43e0ea8d05f2874e20fb205744304f215cef862c
Author: Jean Brefort <jean brefort normalesup org>
Date: Fri Sep 11 19:42:49 2015 +0200
Fix snap to grid for one cell or basolute anchored objects. [#754792]
ChangeLog | 5 +++++
NEWS | 1 +
src/sheet-object.c | 8 ++++++++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f47a2e9..116614f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-11 Jean Brefort <jean brefort normalesup org>
+
+ * src/sheet-object.c (cb_so_snap_to_grid): fixed for one cell and absolute
+ anchors. [#754792]
+
2015-08-24 Jean Brefort <jean brefort normalesup org>
* src/sheet-object.c (sheet_object_update_bounds),
diff --git a/NEWS b/NEWS
index 2585838..311452c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.12.24
Jean:
* Fix printing of sheet objects with one cell or absolute anchors. [#753961]
+ * Fix snap to grid for one cell or basolute anchored objects. [#754792]
--------------------------------------------------------------------------
Gnumeric 1.12.23
diff --git a/src/sheet-object.c b/src/sheet-object.c
index eae7dd8..d997880 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -135,8 +135,16 @@ cb_so_snap_to_grid (SheetObject *so, SheetControl *sc)
{
SheetObjectAnchor *snapped =
sheet_object_anchor_dup (sheet_object_get_anchor (so));
+ GnmSOAnchorMode mode = snapped->mode;
+ snapped->mode = GNM_SO_ANCHOR_TWO_CELLS;
snapped->offset[0] = snapped->offset[1] = 0.;
snapped->offset[2] = snapped->offset[3] = 1.;
+ if (mode != GNM_SO_ANCHOR_TWO_CELLS) {
+ double pts[4];
+ sheet_object_anchor_to_pts (snapped, so->sheet, pts);
+ snapped->mode = mode;
+ sheet_object_pts_to_anchor (snapped, so->sheet, pts);
+ }
cmd_objects_move (sc_wbc (sc),
g_slist_prepend (NULL, so),
g_slist_prepend (NULL, snapped),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]