[goffice] Fix selection of axes using only part fo the plot area. [#746456]



commit 551bef91809fc82eebfc4ed66ceff1265dc60980
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Mar 19 15:45:33 2015 +0100

    Fix selection of axes using only part fo the plot area. [#746456]

 ChangeLog                     |    5 +++++
 NEWS                          |    3 +++
 goffice/graph/gog-axis-line.c |    7 +++++++
 3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index dd285b6..7693ad6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-19  Jean Brefort  <jean brefort normalesup org>
+
+       * goffice/graph/gog-axis-line.c (axis_line_point): fix selection of
+       axes using only part fo the plot area. [#746456]
+
 2015-03-13  Jean Brefort  <jean brefort normalesup org>
 
        reviewed by: <delete if not using a buddy>
diff --git a/NEWS b/NEWS
index 0f45bc3..3cff864 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.10.22:
 
+Jean:
+       * Fix selection of axes using only part fo the plot area. [#746456]
+
 Johannes Deutsch:
        * Do not draw the line over the arrow head at start. [#745736]
 
diff --git a/goffice/graph/gog-axis-line.c b/goffice/graph/gog-axis-line.c
index 970f253..74f2716 100644
--- a/goffice/graph/gog-axis-line.c
+++ b/goffice/graph/gog-axis-line.c
@@ -1003,6 +1003,13 @@ axis_line_point (GogAxisBase *axis_base, GogRenderer *renderer,
        double padding = gog_axis_base_get_padding (axis_base);
        double cos_alpha, sin_alpha;
 
+       /* we need to take the axis span into account, see #746456 */
+       /* using cos_alpha and sin-alpha to store the axis span for now */
+       gog_axis_get_effective_span (axis_base->axis, &cos_alpha, &sin_alpha);
+       xa += wa * cos_alpha;
+       ya += ha * cos_alpha;
+       wa *= (sin_alpha - cos_alpha);
+       ha *= (sin_alpha - cos_alpha);
        go_geometry_cartesian_to_polar (wa, ha, &axis_length, &axis_angle);
        cos_alpha = side == GO_SIDE_LEFT ? - sin (axis_angle) : + sin (axis_angle);
        sin_alpha = side == GO_SIDE_LEFT ? + cos (axis_angle) : - cos (axis_angle);


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