mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-02 23:50:10 +01:00
tools: measure touchpad-pressure: prevent division by zero
And make sure the equivalent entry in the measure touch-size is long enough to overwrite the current status line https://gitlab.freedesktop.org/libinput/libinput/issues/42 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
734496d972
commit
a5700dcf43
2 changed files with 4 additions and 1 deletions
|
|
@ -138,7 +138,7 @@ class TouchSequence(object):
|
|||
|
||||
def _str_summary(self):
|
||||
if not self.points:
|
||||
return "Sequence: no major/minor values recorded"
|
||||
return "{:78s}".format("Sequence: no major/minor values recorded")
|
||||
|
||||
s = "Sequence: major: [{:3d}..{:3d}] ".format(
|
||||
self.major_range.min, self.major_range.max
|
||||
|
|
|
|||
|
|
@ -105,6 +105,9 @@ class TouchSequence(object):
|
|||
return self._str_state() if self.is_active else self._str_summary()
|
||||
|
||||
def _str_summary(self):
|
||||
if not self.points:
|
||||
return "{:78s}".format("Sequence: no pressure values recorded")
|
||||
|
||||
s = "Sequence {} pressure: "\
|
||||
"min: {:3d} max: {:3d} avg: {:3d} median: {:3d} tags:" \
|
||||
.format(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue