From a8eea6e9c1f32d5562594656c68dc4b9f985b790 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 14 Nov 2020 09:46:34 +0100 Subject: Add x_offset to drawable::line to be able to have drawImage render images outside the parent area. --- plugingui/texture.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugingui/texture.cc') diff --git a/plugingui/texture.cc b/plugingui/texture.cc index a5908cb..8cd7040 100644 --- a/plugingui/texture.cc +++ b/plugingui/texture.cc @@ -59,9 +59,9 @@ const Colour& Texture::getPixel(size_t x, size_t y) const return image.getPixel(x + _x, y + _y); } -const std::uint8_t* Texture::line(std::size_t y) const +const std::uint8_t* Texture::line(std::size_t y, std::size_t x_offset) const { - return image.line(y + _y) + _x * 4; + return image.line(y + _y) + _x * 4 + x_offset * 4; } bool Texture::hasAlpha() const -- cgit v1.2.3