GNOME Bugzilla – Bug 645805
incorrect sheet object moves
Last modified: 2011-03-27 08:02:25 UTC
With a selected sheet object, shift-arrow should move the object by a row or column. It seems that we have an additional move perpendicular to the intended one. Note that in static void drag_object (SheetObject *so, double *coords, ObjDragInfo *info) { static struct { int x_idx, y_idx; } const idx_info[8] = { { 0, 1}, {-1, 1}, { 2, 1}, { 0,-1}, { 2,-1}, { 0, 3}, {-1, 3}, { 2, 3} }; g_return_if_fail (info->drag_type <= 8); if (info->drag_type == 8) { apply_move (so, 0, 1, coords, info, info->snap_to_grid); apply_move (so, 2, 3, coords, info, FALSE); } else apply_move (so, idx_info[info->drag_type].x_idx, idx_info[info->drag_type].y_idx, coords, info, info->snap_to_grid); SCG_FOREACH_PANE (info->scg, pane, gnm_pane_object_update_bbox (pane, so);); } we have two "apply_move" in this case which is somewhat surprising.
The problem seems to be due to the snap-to-grid. Repeated snapping to grid moves us right or down.
We can fix this issue by deleting the "0.5" inside: static double snap_pos_to_grid (ObjDragInfo const *info, gboolean is_col, double w_pos, gboolean to_min) { ... double pos = w_pos + 0.5; I don't quite know why we had this here in the first place so I am hesitant just to change it and possibly causing a different bug elsewhere.
May be: floor (w_pos . 0.5);
floor (w_pos + 0.5);
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Note that I just skipped the 0.5. We should remember tis though in case we are observing some issues.