fix getting width and height
This commit is contained in:
parent
125110ee51
commit
941f5f0a60
@ -6,6 +6,7 @@ class Chip(metaclass=abc.ABCMeta):
|
||||
"""Chip class"""
|
||||
def __init__(self, width, height, driver, auto_flush):
|
||||
self.options = {}
|
||||
self.rotation = 0
|
||||
self._width = width
|
||||
self._height = height
|
||||
self.driver = driver
|
||||
@ -14,12 +15,18 @@ class Chip(metaclass=abc.ABCMeta):
|
||||
@property
|
||||
def width(self):
|
||||
"""get width"""
|
||||
return self._width
|
||||
if self.rotation == 0 or self.rotation == 180:
|
||||
return self._width
|
||||
else:
|
||||
return self._height
|
||||
|
||||
@property
|
||||
def height(self):
|
||||
"""get height"""
|
||||
return self._height
|
||||
if self.rotation == 0 or self.rotation == 180:
|
||||
return self._height
|
||||
else:
|
||||
return self._width
|
||||
|
||||
@abc.abstractmethod
|
||||
def _converted_background_color(self):
|
||||
|
@ -11,7 +11,6 @@ class ILI9486(Area, Chip):
|
||||
def __init__(self, width, height, driver):
|
||||
Chip.__init__(self, width, height, driver, True)
|
||||
Area.__init__(self, driver)
|
||||
self.rotation = 0
|
||||
|
||||
def _converted_background_color(self):
|
||||
"""color from 8-8-8 to 5-6-5"""
|
||||
|
Loading…
Reference in New Issue
Block a user