mirror of
https://github.com/esphome/esphome.git
synced 2026-01-09 19:50:49 -07:00
[hub75] Add clipping check (#12762)
This commit is contained in:
@@ -111,6 +111,9 @@ void HOT HUB75Display::draw_pixel_at(int x, int y, Color color) {
|
|||||||
if (x >= this->get_width_internal() || x < 0 || y >= this->get_height_internal() || y < 0) [[unlikely]]
|
if (x >= this->get_width_internal() || x < 0 || y >= this->get_height_internal() || y < 0) [[unlikely]]
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!this->get_clipping().inside(x, y))
|
||||||
|
return;
|
||||||
|
|
||||||
driver_->set_pixel(x, y, color.r, color.g, color.b);
|
driver_->set_pixel(x, y, color.r, color.g, color.b);
|
||||||
App.feed_wdt();
|
App.feed_wdt();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user