mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Support 90 and 270 rotation
This commit is contained in:
@ -319,7 +319,7 @@ class Display(View):
|
||||
def image(self):
|
||||
img = None
|
||||
if self._canvas is not None:
|
||||
img = self._canvas if self._rotation == 0 else self._canvas.rotate(-self._rotation)
|
||||
img = self._canvas if self._rotation == 0 else self._canvas.rotate(-self._rotation, expand=True)
|
||||
return img
|
||||
|
||||
def _render_thread(self):
|
||||
@ -338,7 +338,7 @@ class Display(View):
|
||||
logging.error("%s" % e)
|
||||
|
||||
if self._enabled:
|
||||
self._canvas = (img if self._rotation == 0 else img.rotate(self._rotation))
|
||||
self._canvas = (img if self._rotation == 0 else img.rotate(self._rotation, expand=True))
|
||||
if self._implementation is not None:
|
||||
self._canvas_next = self._canvas
|
||||
self._canvas_next_event.set()
|
||||
|
@ -49,8 +49,14 @@ class View(object):
|
||||
self._voice = Voice(lang=config['main']['lang'])
|
||||
self._implementation = impl
|
||||
self._layout = impl.layout()
|
||||
self._width = self._layout['width']
|
||||
self._height = self._layout['height']
|
||||
self._rotation = config['ui']['display'].get('rotation',0)
|
||||
if (self._rotation/90)%2 == 0:
|
||||
self._width = self._layout['width']
|
||||
self._height = self._layout['height']
|
||||
else:
|
||||
self._width = self._layout['height']
|
||||
self._height = self._layout['width']
|
||||
|
||||
self._state = State(state={
|
||||
'channel': LabeledValue(color=BLACK, label='CH', value='00', position=self._layout['channel'],
|
||||
label_font=fonts.Bold,
|
||||
|
Reference in New Issue
Block a user