setPixel with 'double'-coordinates

This commit is contained in:
Patrick Haßel 2025-01-25 21:14:52 +01:00
parent d57ef636f2
commit 705e8c7d77

View File

@ -89,6 +89,10 @@ public:
fillRect(0, 0, width, height, Black); fillRect(0, 0, width, height, Black);
} }
void setPixel(const double x, const double y, const RGBA color) {
setPixel(static_cast<int>(round(x)), static_cast<int>(round(y)), color);
}
void setPixel(const int x, const int y, const RGBA color) { void setPixel(const int x, const int y, const RGBA color) {
if (x < 0 || x >= width || y < 0 || y >= height) { if (x < 0 || x >= width || y < 0 || y >= height) {
return; return;