[gnumeric] Really fix text position inside path.



commit 5f27965f419d8079dc5f708a891e85999997d371
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Jul 18 12:38:29 2013 +0200

    Really fix text position inside path.

 ChangeLog         |    5 +++++
 src/gnm-so-path.c |   12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6759716..efd04ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-18  Jean Brefort  <jean brefort normalesup org>
+
+       * src/gnm-so-path.c (so_path_view_set_bounds),
+       (cb_gnm_so_path_changed): a better fix for the text position.
+
 2013-07-17  Jean Brefort  <jean brefort normalesup org>
 
        * src/gnm-so-filled.c (so_filled_view_set_bounds),
diff --git a/src/gnm-so-path.c b/src/gnm-so-path.c
index 12104b2..b875753 100644
--- a/src/gnm-so-path.c
+++ b/src/gnm-so-path.c
@@ -120,8 +120,8 @@ so_path_view_set_bounds (SheetObjectView *sov, double const *coords, gboolean vi
                        }
                        x1 -= x0 + sop->margin_pts.left + sop->margin_pts.right;
                        y1 -= y0 + sop->margin_pts.top + sop->margin_pts.bottom;
-                       x0 += x1 / 2.;
-                       y0 += y1 / 2.;
+                       x0 += x1 / 2. + sop->margin_pts.left;
+                       y0 += y1 / 2. + sop->margin_pts.top;
                        x1 = MAX (x1, DBL_MIN);
                        y1 = MAX (y1, DBL_MIN);
 
@@ -235,15 +235,15 @@ cb_gnm_so_path_changed (GnmSOPath const *sop,
                        }
                        x1 -= x0 + sop->margin_pts.left + sop->margin_pts.right;
                        y1 -= y0 + sop->margin_pts.top + sop->margin_pts.bottom;
-                       x0 += x1 / 2.;
-                       y0 += y1 / 2.;
+                       x0 += x1 / 2. + sop->margin_pts.left;
+                       y0 += y1 / 2. + sop->margin_pts.top;
                        x1 = MAX (x1, DBL_MIN);
                        y1 = MAX (y1, DBL_MIN);
                        group->text = goc_item_new (GOC_GROUP (group), GOC_TYPE_TEXT,
                                "anchor",       GO_ANCHOR_CENTER,
                                "clip",         TRUE,
-                               "x",            x1 / 2.,
-                               "y",            y1 / 2.,
+                               "x",            x0,
+                               "y",            y0,
                        "clip-height", y1,
                        "clip-width",  x1,
                        "wrap-width",  x1,


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