]> git.pld-linux.org Git - packages/gnuplot.git/commitdiff
- fix rouding (patch from rawhide).
authorkloczek <kloczek@pld-linux.org>
Sat, 3 Aug 2002 22:45:10 +0000 (22:45 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gnuplot-round.patch -> 1.1

gnuplot-round.patch [new file with mode: 0644]

diff --git a/gnuplot-round.patch b/gnuplot-round.patch
new file mode 100644 (file)
index 0000000..150cd73
--- /dev/null
@@ -0,0 +1,39 @@
+--- gnuplot-3.7.1/graphics.c.round     Wed Sep 15 09:30:29 1999
++++ gnuplot-3.7.1/graphics.c   Wed Jun  6 15:59:07 2001
+@@ -583,7 +583,8 @@
+     /* compute ytop from the various components
+      *     unless tmargin is explicitly specified  */
+-    ytop = (int) ((ysize + yoffset) * (t->ymax));
++    /* HBB 20010118: fix round-off bug */
++    ytop = (int) (0.5 + (ysize + yoffset) * (t->ymax));
+     if (tmargin < 0) {
+       int top_margin = x2label_textheight + title_textheight;
+@@ -668,7 +669,7 @@
+     /* compute ybot from the various components
+      *     unless bmargin is explicitly specified  */
+-    ybot = (int) ((t->ymax) * yoffset);
++    ybot = (int) (0.5 + (t->ymax) * yoffset);
+     if (bmargin < 0) {
+       ybot += xtic_height + xtic_textheight;
+@@ -844,7 +845,7 @@
+     /* compute xleft from the various components
+      *     unless lmargin is explicitly specified  */
+-    xleft = (int) ((t->xmax) * xoffset);
++    xleft = (int) (0.5 + (t->xmax) * xoffset);
+     if (lmargin < 0) {
+       xleft += (timelabel_textwidth > ylabel_textwidth ? timelabel_textwidth : ylabel_textwidth)
+@@ -905,7 +906,7 @@
+     /* compute xright from the various components
+      *     unless rmargin is explicitly specified  */
+-    xright = (int) ((t->xmax) * (xsize + xoffset));
++    xright = (int) (0.5 + (t->xmax) * (xsize + xoffset));
+     if (rmargin < 0) {
+       /* xright -= y2label_textwidth + y2tic_width + y2tic_textwidth; */
This page took 0.047042 seconds and 4 git commands to generate.