Skip to content

Commit

Permalink
Fix setting draw color (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
loilo authored and kazsaj committed Nov 27, 2018
1 parent d0df9fc commit 386cee4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tFPDF/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -864,16 +864,16 @@ public function SetDrawColor()
}
switch (count($args)) {
case 1:
$this->str_fill_color = sprintf('%.3f G', $args[0] / 100);
$this->str_draw_color = sprintf('%.3f G', $args[0] / 100);
break;
case 3:
$this->str_fill_color = sprintf('%.3f %.3f %.3f RG', $args[0] / 255, $args[1] / 255, $args[2] / 255);
$this->str_draw_color = sprintf('%.3f %.3f %.3f RG', $args[0] / 255, $args[1] / 255, $args[2] / 255);
break;
case 4:
$this->str_fill_color = sprintf('%.3f %.3f %.3f %.3f K', $args[0] / 100, $args[1] / 100, $args[2] / 100, $args[3] / 100);
$this->str_draw_color = sprintf('%.3f %.3f %.3f %.3f K', $args[0] / 100, $args[1] / 100, $args[2] / 100, $args[3] / 100);
break;
default:
$this->str_fill_color = '0 G';
$this->str_draw_color = '0 G';
}
if ($this->int_page > 0) {
$this->Out($this->str_draw_color);
Expand Down

0 comments on commit 386cee4

Please sign in to comment.