Skip to content

Commit

Permalink
Update frame_buffer.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaweees committed Oct 16, 2024
1 parent 51102ce commit 9333157
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frame_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FrameBuffer::FrameBuffer(int width, int height)
: width(width), height(height), buffer(width * height, 0) {}

void FrameBuffer::drawPixel(int x, int y, const Color &color) {
if (x >= 0 && x < width && y >= 0 && y < height) {
if (0 <= x && x < width && 0 <= y && y < height) {
buffer[(width * y) + x] = static_cast<uint32_t>(color);
}
}
Expand Down

0 comments on commit 9333157

Please sign in to comment.