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:
committed by
Jesse Hills
parent
078eaff9a8
commit
b6bb6699d1
@@ -309,8 +309,12 @@ class DriverChip:
|
|||||||
CONF_NATIVE_HEIGHT, height + offset_height * 2
|
CONF_NATIVE_HEIGHT, height + offset_height * 2
|
||||||
)
|
)
|
||||||
offset_height = native_height - height - offset_height
|
offset_height = native_height - height - offset_height
|
||||||
# Swap default dimensions if swap_xy is set
|
# Swap default dimensions if swap_xy is set, or if rotation is 90/270 and we are not using a buffer
|
||||||
if transform[CONF_SWAP_XY] is True:
|
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
|
width, height = height, width
|
||||||
offset_height, offset_width = offset_width, offset_height
|
offset_height, offset_width = offset_width, offset_height
|
||||||
return width, height, offset_width, offset_height
|
return width, height, offset_width, offset_height
|
||||||
|
Reference in New Issue
Block a user