setPixelSafe method
Set the pixel at the given x
, y
coordinate to the color
.
If the pixel coordinates are out of bounds, nothing is done.
Implementation
void setPixelSafe(int x, int y, int color) {
if (boundsSafe(x, y)) {
data[y * width + x] = color;
}
}