From 840d0cf3efba1931f6383170f66dc59bb1a3201ad36702c09d0aff8e3b9f15ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojtek=20Dziewi=C4=99cki?= Date: Mon, 18 Nov 2013 11:57:24 +0000 Subject: [PATCH] - Fix bnc#793636 almost undistinguishable wheter there is "no data" or "zero valued data" on the rendered graph - rrdtool-zero_vs_nothing.patch - I did this to prepare rrdtool for SLE12 - bnc#831773 - [openSUSE goes SLE12]: rrdtool: Change and/or patches may have been lost OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=49 --- rrdtool-zero_vs_nothing.patch | 29 +++++++++++++++++++++++++++++ rrdtool.changes | 8 ++++++++ rrdtool.spec | 2 ++ 3 files changed, 39 insertions(+) create mode 100644 rrdtool-zero_vs_nothing.patch diff --git a/rrdtool-zero_vs_nothing.patch b/rrdtool-zero_vs_nothing.patch new file mode 100644 index 0000000..a2931cc --- /dev/null +++ b/rrdtool-zero_vs_nothing.patch @@ -0,0 +1,29 @@ +Index: rrdtool-1.4.7/src/rrd_gfx.c +=================================================================== +--- rrdtool-1.4.7.orig/src/rrd_gfx.c ++++ rrdtool-1.4.7/src/rrd_gfx.c +@@ -293,10 +293,10 @@ void gfx_line_fit( + line_width = cairo_get_line_width(cr); + line_height = line_width; + cairo_user_to_device_distance(cr, &line_width, &line_height); +- line_width = line_width / 2.0 - ceil(line_width / 2.0); +- line_height = line_height / 2.0 - ceil(line_height / 2.0); +- *x = floor(*x - 0.5) - line_width; +- *y = ceil(*y + 0.5) + line_height; ++ line_width = line_width / 2.0 - (long) (line_width / 2.0); ++ line_height = line_height / 2.0 - (long) (line_height / 2.0); ++ *x = (double) ((long) (*x + 0.5)) - line_width; ++ *y = (double) ((long) (*y + 0.5)) + line_height; + cairo_device_to_user(cr, x, y); + } + +@@ -312,7 +312,7 @@ void gfx_area_fit( + if (!im->gridfit) + return; + cairo_user_to_device(cr, x, y); +- *x = floor(*x); +- *y = ceil(*y); ++ *x = (double) ((long) (*x + 0.5)); ++ *y = (double) ((long) (*y + 0.5)); + cairo_device_to_user(cr, x, y); + } diff --git a/rrdtool.changes b/rrdtool.changes index bd27e8e..b85a11d 100644 --- a/rrdtool.changes +++ b/rrdtool.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Nov 18 11:33:36 UTC 2013 - vdziewiecki@suse.com + +- Fix bnc#793636 almost undistinguishable wheter there is "no data" + or "zero valued data" on the rendered graph - rrdtool-zero_vs_nothing.patch +- I did this to prepare rrdtool for SLE12 - bnc#831773 - [openSUSE goes SLE12]: rrdtool: Change and/or patches may have been lost + + ------------------------------------------------------------------- Fri Oct 4 17:01:23 UTC 2013 - p.drouand@gmail.com diff --git a/rrdtool.spec b/rrdtool.spec index ae33a62..b626cad 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -46,6 +46,7 @@ Patch2: rrdtool-tclversion.patch Patch3: rrdtool-tclsegfault.patch Source1: http://www.infodrom.org/projects/cgilib/download/cgilib-%{cgilib_version}.tar.gz Patch11: cgilib-fix_automake.patch +Patch12: rrdtool-zero_vs_nothing.patch Source2: sysconfig.rrdcached Source4: rrdcached-systemd-pre Source5: rrdcached.service @@ -153,6 +154,7 @@ daemon was written to alleviate these problems. pushd "cgilib-%{cgilib_version}" %patch11 popd #cgilib +%patch12 -p1 %build # first prepare cgilib