From 1ea449630d835095d9cab47fd53d035dee9663ed Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 11 Dec 2011 15:55:31 +0000 Subject: (svn r23497) -Add: Advanced display setting to control the linewidth in graphs. (ChillCore) --- src/graph_gui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/graph_gui.cpp') diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 65f688c5d..44d281a2e 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -419,6 +419,9 @@ protected: } /* draw lines and dots */ + uint linewidth = _settings_client.gui.graph_line_thickness; + uint pointoffs1 = (linewidth + 1) / 2; + uint pointoffs2 = linewidth + 1 - pointoffs1; for (int i = 0; i < this->num_dataset; i++) { if (!HasBit(this->excluded_data, i)) { /* Centre the dot between the grid lines. */ @@ -455,10 +458,10 @@ protected: y = r.top + x_axis_offset - ((r.bottom - r.top) * datapoint) / (interval_size >> reduce_range); /* Draw the point. */ - GfxFillRect(x - 2, y - 2, x + 2, y + 2, colour); + GfxFillRect(x - pointoffs1, y - pointoffs1, x + pointoffs2, y + pointoffs2, colour); /* Draw the line connected to the previous point. */ - if (prev_x != INVALID_DATAPOINT_POS) GfxDrawLine(prev_x, prev_y, x, y, colour, 3); + if (prev_x != INVALID_DATAPOINT_POS) GfxDrawLine(prev_x, prev_y, x, y, colour, linewidth); prev_x = x; prev_y = y; -- cgit v1.2.3-54-g00ecf