Commit 1564c03d authored by Jason Rhinelander's avatar Jason Rhinelander

y grid lines need to be at floating point locations

parent d84c1b40
......@@ -100,7 +100,7 @@ class SeriesGraphs : public CmdArgs {
*/
int data_max_t = -1;
/** Draw extra-wide graph t grid marks at these points. Typically the piracy-begins and
/** Draw heavier graph t grid marks at these points. Typically the piracy-begins and
* policy-begins periods.
*/
std::vector<int> t_extra;
......
......@@ -374,7 +374,7 @@ void Series::finishPage() {
drawRectangle(ctx, graph_outer_width, graph_outer_height, graph_style, true);
// We're now clipped inside it
std::tuple<LineStyle&, std::set<int>&, std::set<int>&>
std::tuple<LineStyle&, std::set<int>&, std::set<double>&>
tick_grid(tick_grid_style, t_grid, y_grid),
tick_grid_extra(tick_grid_extra_style, t_grid_extra, y_grid_extra);
......@@ -382,7 +382,8 @@ void Series::finishPage() {
// If we have tick grid lines, draw them:
for (const auto &tg : {tick_grid, tick_grid_extra}) {
auto &style = std::get<0>(tg);
auto &ts = std::get<1>(tg), &ys = std::get<2>(tg);
auto &ts = std::get<1>(tg);
auto &ys = std::get<2>(tg);
if (style.colour and not (ts.empty() and ys.empty())) {
for (const auto &t : ts) {
double grid_x = t, dontcare = 0;
......
......@@ -402,10 +402,10 @@ class Series {
* This will, by default, be equal to y_ticks if recalcTicks() is called with TickEnds::None;
* for the other end modes, the grid end points can differ.
*/
std::set<int> y_grid;
std::set<double> y_grid;
/** Like t_grid_extra, but for y axis values. */
std::set<int> y_grid_extra;
std::set<double> y_grid_extra;
/** Different modes for what to do with the tmin/tmax/ymin/ymax graph end points given
* during construction. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment