diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-04 11:49:36 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-04 11:49:36 -0400 |
commit | e48ae4692975df8ef09071933baa2ed8cf0fd0d0 (patch) | |
tree | e87929b675c2ed4f8fe99dfb5faed1cc4c8dbd52 | |
parent | a346edd547cfc782550dc3c039869c34f61fd690 (diff) | |
download | phoronix-test-suite-upstream-e48ae4692975df8ef09071933baa2ed8cf0fd0d0.tar.gz phoronix-test-suite-upstream-e48ae4692975df8ef09071933baa2ed8cf0fd0d0.tar.xz phoronix-test-suite-upstream-e48ae4692975df8ef09071933baa2ed8cf0fd0d0.zip |
pts_LineGraph: Fix for preventing the line from being drawn off the
drawing window in some cases.
-rw-r--r-- | pts-core/objects/pts_LineGraph.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pts-core/objects/pts_LineGraph.php b/pts-core/objects/pts_LineGraph.php index 418f1b5..9d51c6e 100644 --- a/pts-core/objects/pts_LineGraph.php +++ b/pts-core/objects/pts_LineGraph.php @@ -80,6 +80,9 @@ class pts_LineGraph extends pts_CustomGraph $value_plot_top = $this->graph_top_end + 1 - round(($value / $this->graph_maximum_value) * ($this->graph_top_end - $this->graph_top_start)); $px_from_left = $this->graph_left_start + ($this->identifier_width * ($i + 1)); + if($px_from_left > $this->graph_left_end) + $px_from_left = $this->graph_left_end - 1; + if($previous_placement != -1 && $previous_offset != -1) { imageline($this->graph_image, $previous_offset, $previous_placement, $px_from_left, $value_plot_top, $paint_color); |