summaryrefslogtreecommitdiff
path: root/src/graph_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-12-11 15:55:31 +0000
committerfrosch <frosch@openttd.org>2011-12-11 15:55:31 +0000
commit1ea449630d835095d9cab47fd53d035dee9663ed (patch)
tree189b864b55b729a9b232b6cb8fe9453fe081b72f /src/graph_gui.cpp
parent8f36e70e354c7af1f82d27f406d02a0bf9528b45 (diff)
downloadopenttd-1ea449630d835095d9cab47fd53d035dee9663ed.tar.xz
(svn r23497) -Add: Advanced display setting to control the linewidth in graphs. (ChillCore)
Diffstat (limited to 'src/graph_gui.cpp')
-rw-r--r--src/graph_gui.cpp7
1 files changed, 5 insertions, 2 deletions
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;