From 395a8a909a66a7eb1969f9cf9a0bea841c5f976e Mon Sep 17 00:00:00 2001 From: Simone Margaritelli <evilsocket@gmail.com> Date: Sat, 28 Sep 2019 20:02:47 +0200 Subject: [PATCH] fixed face position fore waveshare --- .../rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/view.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/view.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/view.py index 6186ad5..9b92219 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/view.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/view.py @@ -25,13 +25,19 @@ class View(object): if config['ui']['display']['type'] in ('inky', 'inkyphat'): self._width = 212 self._height = 104 + fonts.setup(10, 8, 10, 25) + + face_pos = (0, int(self._height / 4)) name_pos = (int(self._width / 2) - 15, int(self._height * .15)) status_pos = (int(self._width /2) - 15, int(self._height * .30)) elif config['ui']['display']['type'] in ('ws', 'waveshare'): self._width = 250 self._height = 122 + fonts.setup(10, 9, 10, 35) + + face_pos = (0, 40) name_pos = (125, 20) status_pos = (125, 35) @@ -53,7 +59,7 @@ class View(object): # 'histogram': Histogram([4, 94], color = BLACK), - 'face': Text(value=faces.SLEEP, position=(0, int(self._height / 4)), color=BLACK, font=fonts.Huge), + 'face': Text(value=faces.SLEEP, position=face_pos, color=BLACK, font=fonts.Huge), 'friend_face': Text(value=None, position=(0, 90), font=fonts.Bold, color=BLACK), 'friend_name': Text(value=None, position=(40, 93), font=fonts.BoldSmall, color=BLACK),