Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phplotdocs/phplot.php
42 changes: 27 additions & 15 deletions src/phplot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
);

Expand Down Expand Up @@ -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';