Merge pull request #93 from glathoud/patch-1

fix #92 TrueColorImage.setPixel not working on the last 3 pixels
This commit is contained in:
Adam D. Ruppe 2016-10-13 07:51:13 -04:00 committed by GitHub
commit d09b2542cd
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
}