diff options
author | Javier <dev.git@javispedro.com> | 2021-09-20 00:45:38 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2021-09-20 00:45:38 +0200 |
commit | d0e882e6b759ffe18a545cb8cce18ca402eac763 (patch) | |
tree | 2cf463f5cfa486982a47ae1fcae5ef0d54399da1 /stfexporter.cc | |
parent | 8f5e61797d35ef376f9eb7af78731daec9a49091 (diff) | |
download | scribiu-d0e882e6b759ffe18a545cb8cce18ca402eac763.tar.gz scribiu-d0e882e6b759ffe18a545cb8cce18ca402eac763.zip |
use stf speed to compute time between stroke points in txyf export
Diffstat (limited to 'stfexporter.cc')
-rw-r--r-- | stfexporter.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/stfexporter.cc b/stfexporter.cc index fcd7194..1503ae4 100644 --- a/stfexporter.cc +++ b/stfexporter.cc @@ -26,14 +26,12 @@ class StfToTXYP : public StfReader::StrokeHandler { QTextStream _out; - QPoint _lastP; - int _lastForce; qint64 _startTime; bool _relativeTime; public: StfToTXYP(QIODevice *out, bool relativeTime) - : _out(out), _lastP(), _lastForce(0), _startTime(0), _relativeTime(relativeTime) { + : _out(out), _startTime(0), _relativeTime(relativeTime) { _out << "T\tX\tY\tP\n"; } @@ -42,24 +40,17 @@ public: _startTime = time; } _out << (time - _startTime) << '\t' << p.x() << '\t' << p.y() << '\t' << force << '\n'; - _lastP = p; - _lastForce = force; return true; } bool strokePoint(const QPoint& p, int force, qint64 time) { _out << (time - _startTime) << '\t' << p.x() << '\t' << p.y() << '\t' << force << '\n'; - _lastP = p; - _lastForce = force; return true; } bool endStroke(qint64 time) { - // Ensure there is a entry with force=0, in case the pen didn't provide it - if (_lastForce != 0) { - _out << (time - _startTime) << '\t' << _lastP.x() << '\t' << _lastP.y() << '\t' << 0 << '\n'; - _lastForce = 0; - } + // Force == 0 is used to detect strokes + Q_UNUSED(time); return true; } }; |