aboutsummaryrefslogtreecommitdiff
path: root/stfexporter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'stfexporter.cc')
-rw-r--r--stfexporter.cc15
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;
}
};