[GRASS-SVN] r69668 - grass/trunk/display/d.linegraph
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Oct 3 16:39:22 PDT 2016
Author: wenzeslaus
Date: 2016-10-03 16:39:22 -0700 (Mon, 03 Oct 2016)
New Revision: 69668
Modified:
grass/trunk/display/d.linegraph/main.c
Log:
d.linegraph: do not draw from 0,0
There is no data at 0,0 (xoffset,yoffset), so there
is no reason to draw the a from there.
We start with the first actual data point.
Modified: grass/trunk/display/d.linegraph/main.c
===================================================================
--- grass/trunk/display/d.linegraph/main.c 2016-10-03 23:28:48 UTC (rev 69667)
+++ grass/trunk/display/d.linegraph/main.c 2016-10-03 23:39:22 UTC (rev 69668)
@@ -516,11 +516,9 @@
}
new_x = xoffset + (line * xscale);
- if (line == 0) {
- prev_x = xoffset;
- prev_y[i] = yoffset;
- }
- D_line_abs(prev_x, prev_y[i], new_x, new_y[i]);
+ /* draw only when we the previous point to start from */
+ if (line > 0)
+ D_line_abs(prev_x, prev_y[i], new_x, new_y[i]);
prev_y[i] = new_y[i];
}
}
More information about the grass-commit
mailing list