mirror of https://github.com/adamdruppe/arsd.git
fix #92 TrueColorImage.setPixel not working on the last 3 pixels
This commit is contained in:
parent
ccdb70c656
commit
04fef6bee0
2
color.d
2
color.d
|
@ -970,7 +970,7 @@ class TrueColorImage : MemoryImage {
|
||||||
override void setPixel(int x, int y, in Color clr) @trusted {
|
override void setPixel(int x, int y, in Color clr) @trusted {
|
||||||
if (x >= 0 && y >= 0 && x < _width && y < _height) {
|
if (x >= 0 && y >= 0 && x < _width && y < _height) {
|
||||||
uint pos = y*_width+x;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue