diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-11-14 09:46:34 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-11-14 12:08:50 +0100 |
commit | a8eea6e9c1f32d5562594656c68dc4b9f985b790 (patch) | |
tree | fd44df99b9ff3bd4b4a19003653dbfa814e29f0c /plugingui/painter.cc | |
parent | acc285b59b264c6d8b1e724a883c56e7f24d22b0 (diff) |
Add x_offset to drawable::line to be able to have drawImage render images outside the parent area.
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r-- | plugingui/painter.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugingui/painter.cc b/plugingui/painter.cc index f2fc66a..f746f83 100644 --- a/plugingui/painter.cc +++ b/plugingui/painter.cc @@ -437,21 +437,21 @@ void Painter::drawImage(int x0, int y0, const Drawable& image) } else { - std::size_t x = -1 * std::min(0, x0); + std::size_t x_offset = -1 * std::min(0, x0); for(std::size_t y = -1 * std::min(0, y0); y < (std::size_t)fh; ++y) { - pixbuf.blendLine(x + x0, y + y0, image.line(y), - std::min((int)image.width(), fw - (int)x)); + pixbuf.blendLine(x_offset + x0, y + y0, image.line(y, x_offset), + std::min((int)image.width(), fw - (int)x_offset)); } } } else { - std::size_t x = -1 * std::min(0, x0); + std::size_t x_offset = -1 * std::min(0, x0); for(std::size_t y = -1 * std::min(0, y0); y < (std::size_t)fh; ++y) { - pixbuf.writeLine(x + x0, y + y0, image.line(y), - std::min((int)image.width(), fw - (int)x)); + pixbuf.writeLine(x_offset + x0, y + y0, image.line(y, x_offset), + std::min((int)image.width(), fw - (int)x_offset)); } } } |