Merge pull request #166 from sasanyasari/#165

set background image in RTL mode debugged
This commit is contained in:
Nicola Asuni 2020-02-12 11:10:54 +00:00 committed by GitHub
commit e6f06ee9f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7165,31 +7165,20 @@ class TCPDF {
$info['i'] = $this->setImageBuffer($file, $info);
}
// set alignment
$this->img_rb_x = $x + $w;
$this->img_rb_y = $y + $h;
// set alignment
if ($this->rtl) {
if ($palign == 'L') {
$ximg = $this->lMargin;
} elseif ($palign == 'C') {
$ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2;
} elseif ($palign == 'R') {
$ximg = $this->w - $this->rMargin - $w;
} else {
$ximg = $x - $w;
}
$this->img_rb_x = $ximg;
if ($palign == 'L') {
$ximg = $this->lMargin;
} elseif ($palign == 'C') {
$ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2;
} elseif ($palign == 'R') {
$ximg = $this->w - $this->rMargin - $w;
} else {
if ($palign == 'L') {
$ximg = $this->lMargin;
} elseif ($palign == 'C') {
$ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2;
} elseif ($palign == 'R') {
$ximg = $this->w - $this->rMargin - $w;
} else {
$ximg = $x;
}
$this->img_rb_x = $ximg + $w;
$ximg = $x;
}
if ($ismask OR $hidden) {
// image is not displayed
return $info['i'];