[goffice] Fix a drawing error in contour plots. [#458]



commit 3d376f3b00ec94ad1dc7bdba3198f3af196154f2
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Jan 11 19:56:27 2020 +0100

    Fix a drawing error in contour plots. [#458]

 ChangeLog                          | 5 +++++
 NEWS                               | 1 +
 plugins/plot_surface/gog-contour.c | 6 +++++-
 3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index c80e4bb0..08ffccd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-11  Jean Brefort  <jean brefort normalesup org>
+
+       * plugins/plot_surface/gog-contour.c (gog_contour_view_render): fix a
+       drawing error in contour plots. Fix #458
+
 2019-12-13  Jean Brefort  <jean brefort normalesup org>
 
        * goffice/graph/gog-series-labels.c (gog_series_labels_update):
diff --git a/NEWS b/NEWS
index c99db6c9..a38dc68d 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ goffice 0.10.47:
 Jean:
        * Fix crash if a XY plot series has data labels but no valid data. [#426]
        * Fix criticals related to data labels. [#428]
+       * Fix a drawing error in contour plots. [#458]
 
 Morten:
        * Fix library namespace issue.
diff --git a/plugins/plot_surface/gog-contour.c b/plugins/plot_surface/gog-contour.c
index 47d4505e..d95a0d76 100644
--- a/plugins/plot_surface/gog-contour.c
+++ b/plugins/plot_surface/gog-contour.c
@@ -918,7 +918,11 @@ gog_contour_view_render (GogView *view, GogViewAllocation const *bbox)
                                                }
                                        } else {
                                                k = 0;
-                                               for (s = 0; s < 8; s++) {
+                                               if (xl[0] < 0)
+                                                       go_path_move_to (path, x[0], y[0]);
+                                               else
+                                                       go_path_move_to (path, xl[0], yl[0]);
+                                               for (s = 1; s < 8; s++) {
                                                        if (xl[s] < 0.) {
                                                                if (s == 7)
                                                                        break;


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