1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Add flip X and Y on inkplate6 component (#7904)

Co-authored-by: Antoine Weill--Duflos <antoine@haply.co>
Co-authored-by: David Sichau <sichau@inf.ethz.ch>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: David Sichau <DavidSichau@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Leicas
2025-05-29 01:10:06 -04:00
committed by GitHub
parent 7ac5746e0d
commit 455624105b
3 changed files with 26 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#include "inkplate.h"
#include "esphome/core/log.h"
#include "esphome/core/application.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
@@ -156,6 +156,12 @@ void HOT Inkplate6::draw_absolute_pixel_internal(int x, int y, Color color) {
if (x >= this->get_width_internal() || y >= this->get_height_internal() || x < 0 || y < 0)
return;
if (this->mirror_y_)
y = this->get_height_internal() - y - 1;
if (this->mirror_x_)
x = this->get_width_internal() - x - 1;
if (this->greyscale_) {
int x1 = x / 2;
int x_sub = x % 2;