1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

[mipi_spi] Fix dimensions (#10443)

This commit is contained in:
Clyde Stubbs
2025-08-27 19:30:01 +10:00
committed by Jesse Hills
parent 078eaff9a8
commit b6bb6699d1

View File

@@ -309,8 +309,12 @@ class DriverChip:
CONF_NATIVE_HEIGHT, height + offset_height * 2
)
offset_height = native_height - height - offset_height
# Swap default dimensions if swap_xy is set
if transform[CONF_SWAP_XY] is True:
# Swap default dimensions if swap_xy is set, or if rotation is 90/270 and we are not using a buffer
rotated = not requires_buffer(config) and config.get(CONF_ROTATION, 0) in (
90,
270,
)
if transform[CONF_SWAP_XY] is True or rotated:
width, height = height, width
offset_height, offset_width = offset_width, offset_height
return width, height, offset_width, offset_height