From 04fef6bee03584f18fab91da833f095a7e029e97 Mon Sep 17 00:00:00 2001 From: Guillaume Lathoud Date: Thu, 13 Oct 2016 10:33:36 +0200 Subject: [PATCH] fix #92 TrueColorImage.setPixel not working on the last 3 pixels --- color.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/color.d b/color.d index 107e40d..e79d3f0 100644 --- a/color.d +++ b/color.d @@ -970,7 +970,7 @@ class TrueColorImage : MemoryImage { override void setPixel(int x, int y, in Color clr) @trusted { if (x >= 0 && y >= 0 && x < _width && y < _height) { uint pos = y*_width+x; - if (pos+3 < imageData.bytes.length/4) imageData.colors.ptr[pos] = clr; + if (pos < imageData.bytes.length/4) imageData.colors.ptr[pos] = clr; } }