wacom: store the default point size for each tablet

It'll be overwritten by the messages anyway but for the converter tool this is
handy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
pull/191/head
Peter Hutterer 2019-08-23 13:00:53 +10:00 committed by Benjamin Tissoires
parent 35a0727f4e
commit 9a21c2318a
2 changed files with 6 additions and 3 deletions

View File

@ -44,6 +44,7 @@ def parse_file(filename, file_format, tablet_model, orientation):
width = tablet_model.width width = tablet_model.width
height = tablet_model.height height = tablet_model.height
pressure = tablet_model.pressure pressure = tablet_model.pressure
point_size = tablet_model.point_size
orientation = orientation or tablet_model.orientation orientation = orientation or tablet_model.orientation
stem = Path(filename).stem stem = Path(filename).stem
@ -68,8 +69,7 @@ def parse_file(filename, file_format, tablet_model, orientation):
# to svg. ffs. # to svg. ffs.
svgname = f'{stem}.svg' svgname = f'{stem}.svg'
jsonname = f'{stem}.json' jsonname = f'{stem}.json'
ps = 5 # FIXME: fetch the point size from the settings.ini d = Drawing(svgname, (width * point_size, height * point_size), timestamp)
d = Drawing(svgname, (width * ps, height * ps), timestamp)
def normalize(p): def normalize(p):
NORMALIZED_RANGE = 0x10000 NORMALIZED_RANGE = 0x10000
@ -78,7 +78,7 @@ def parse_file(filename, file_format, tablet_model, orientation):
for s in f.strokes: for s in f.strokes:
stroke = d.new_stroke() stroke = d.new_stroke()
for p in s.points: for p in s.points:
stroke.new_abs((p.x * ps, p.y * ps), normalize(p.p)) stroke.new_abs((p.x * point_size, p.y * point_size), normalize(p.p))
stroke.seal() stroke.seal()
d.seal() d.seal()
if file_format == 'json': if file_format == 'json':

View File

@ -758,6 +758,7 @@ class WacomProtocolSpark(WacomProtocolBase):
y_max = 14800 y_max = 14800
pressure = 1023 pressure = 1023
point_size = 10
protocol = ProtocolVersion.SPARK protocol = ProtocolVersion.SPARK
orientation = 'portrait' orientation = 'portrait'
@ -784,6 +785,7 @@ class WacomProtocolSlate(WacomProtocolSpark):
y_max = 14300 y_max = 14300
pressure = 2047 pressure = 2047
point_size = 10
protocol = ProtocolVersion.SLATE protocol = ProtocolVersion.SLATE
orientation = 'portrait' orientation = 'portrait'
@ -856,6 +858,7 @@ class WacomProtocolIntuosPro(WacomProtocolSlate):
y_max = 29600 y_max = 29600
pressure = 8192 pressure = 8192
point_size = 5
protocol = ProtocolVersion.INTUOS_PRO protocol = ProtocolVersion.INTUOS_PRO
orientation = 'landscape' orientation = 'landscape'