diff --git a/phplotdocs/phplot.php b/phplotdocs/phplot.php index d1f0fee..dde58ae 120000 --- a/phplotdocs/phplot.php +++ b/phplotdocs/phplot.php @@ -1 +1 @@ -../phplot/phplot.php \ No newline at end of file +../src/phplot.php \ No newline at end of file diff --git a/src/phplot.php b/src/phplot.php index e5b7465..b083e23 100644 --- a/src/phplot.php +++ b/src/phplot.php @@ -1908,7 +1908,7 @@ protected function ProcessTextGD($draw_it, $font, $angle, $x, $y, $color, $text, $y = $ypos - $r10 * $factor; // Call ImageString or ImageStringUp: - $draw_func($this->img, $font_number, $x, $y, $lines[$i], $color); + $draw_func($this->img, $font_number, (int)$x, (int)$y, $lines[$i], (int)$color); // Step to the next line of text. This is a rotation of (x=0, y=interline_spacing) $xpos += $r01 * $interline_step; @@ -7520,10 +7520,10 @@ protected function DrawLegend() // Draw color boxes: ImageFilledRectangle( $this->img, - $dot_left_x, - $y1, - $dot_right_x, - $y2, + (int) $dot_left_x, + (int) $y1, + (int) $dot_right_x, + (int) $y2, $this->ndx_data_colors[$color_index] ); // Draw a rectangle around the box, if enabled. @@ -7533,7 +7533,14 @@ protected function DrawLegend() } else { $color = $this->ndx_text_color; } - ImageRectangle($this->img, $dot_left_x, $y1, $dot_right_x, $y2, $color); + ImageRectangle( + $this->img, + (int) $dot_left_x, + (int) $y1, + (int) $dot_right_x, + (int) $y2, + (int) $color + ); } } if (++$color_index > $max_color_index) { @@ -7871,7 +7878,12 @@ protected function DrawBar( } else { // Suppress top shading (Note shade_top==FALSE && shade_side==FALSE is not allowed) $pts = array($x2, $y2, $x2, $y1, $x2 + $shade, $y1 - $shade, $x2 + $shade, $y2 - $shade); } - ImageFilledPolygon($this->img, $pts, count($pts) / 2, $shade_color); + + if (phpversion() > 8.0) { + ImageFilledPolygon($this->img, $pts, $shade_color); + } else { + ImageFilledPolygon($this->img, $pts, count($pts) / 2, $shade_color); + } } // Draw a border around the bar, if enabled. @@ -8327,13 +8339,13 @@ protected function DrawPieChart() // Draw the slice ImageFilledArc( $this->img, - $xpos, - $ypos + $h, - $pie_width, - $pie_height, - $arc_end_angle, - $arc_start_angle, - $slicecol, + (int) $xpos, + (int) $ypos + $h, + (int) $pie_width, + (int) $pie_height, + (int) $arc_end_angle, + (int) $arc_start_angle, + (int) $slicecol, IMG_ARC_PIE ); @@ -10029,4 +10041,4 @@ protected function DrawError($error_message) } // PRS12: Move subclasses to separate files -// require_once 'phplot_truecolor.php'; +// require_once 'phplot_truecolor.php'; \ No newline at end of file