aboutsummaryrefslogtreecommitdiff
path: root/stfgraphicsitem.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2021-09-12 01:36:41 +0200
committerJavier <dev.git@javispedro.com>2021-09-12 01:36:41 +0200
commit66dd35254724ec5d4471a8be71f92e06cf0fa8e8 (patch)
tree1918dcca44dd75108d442bf173b58419ab41a518 /stfgraphicsitem.cc
parent8333259e49fc2961cab0939e3d937167d38a9f9d (diff)
downloadscribiu-66dd35254724ec5d4471a8be71f92e06cf0fa8e8.tar.gz
scribiu-66dd35254724ec5d4471a8be71f92e06cf0fa8e8.zip
add ability to export a stroke list in plain text
Diffstat (limited to 'stfgraphicsitem.cc')
-rw-r--r--stfgraphicsitem.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/stfgraphicsitem.cc b/stfgraphicsitem.cc
index 75c9dfa..7ba173f 100644
--- a/stfgraphicsitem.cc
+++ b/stfgraphicsitem.cc
@@ -28,7 +28,7 @@ class StfToGraphicsPathItems : public StfReader::StrokeHandler {
QGraphicsItem *parent;
PaperReplay::SessionList replays;
PaperReplay::Session replay;
- qint64 startTime, lastTime;
+ qint64 startTime;
QPainterPath path;
QRectF bound;
@@ -37,9 +37,6 @@ public:
: parent(parent), replays(replays), path(), bound(0.0, 0.0, 1.0, 1.0) {
}
- ~StfToGraphicsPathItems() {
- }
-
bool startStroke(const QPoint& p, int force, qint64 time) {
Q_UNUSED(force);
QList<PaperReplay::Session> sessions = replays.sessionsDuringTime(time);
@@ -49,7 +46,6 @@ public:
replay = PaperReplay::Session();
}
startTime = time;
- lastTime = time;
path = QPainterPath(QPointF(p));
return true;
}
@@ -57,14 +53,13 @@ public:
bool strokePoint(const QPoint& p, int force, qint64 time) {
Q_UNUSED(force);
Q_UNUSED(time);
- lastTime = time;
path.lineTo(QPointF(p));
return true;
}
- bool endStroke() {
+ bool endStroke(qint64 time) {
bound |= path.boundingRect();
- new StfStrokeItem(path, replay, startTime, lastTime, parent);
+ new StfStrokeItem(path, replay, startTime, time, parent);
/* Parent will take the child down with him when deleted. */
return true;
}