diff options
author | Javier <dev.git@javispedro.com> | 2021-09-12 19:41:12 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2021-09-12 19:41:12 +0200 |
commit | ac7b085449fb49f54225d22c7c229da6ad120e2b (patch) | |
tree | 7910cc8c9a3268dbacbbe434c7f3cea4eedafd3d /stfreader.cc | |
parent | 66dd35254724ec5d4471a8be71f92e06cf0fa8e8 (diff) | |
download | scribiu-ac7b085449fb49f54225d22c7c229da6ad120e2b.tar.gz scribiu-ac7b085449fb49f54225d22c7c229da6ad120e2b.zip |
remove PEN_EPOCH mistake and get usertime from the pen
Diffstat (limited to 'stfreader.cc')
-rw-r--r-- | stfreader.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/stfreader.cc b/stfreader.cc index ff5e4f4..ad15b59 100644 --- a/stfreader.cc +++ b/stfreader.cc @@ -45,12 +45,12 @@ StfReader::StrokeHandler::~StrokeHandler() bool StfReader::parseV1(BitReader& br) { - qint64 cur_time = 0; + quint64 cur_time = 0; while (!br.atEnd()) { syncV1(br); quint8 header = br.readBits(8); - qint64 time; + quint64 time; QPoint p0, pa; int f0; @@ -81,6 +81,8 @@ bool StfReader::parseV1(BitReader& br) p0.setY(br.readBits(16)); f0 = readForce(br); + quint64 stroke_time = cur_time; + if (handler) { bool res = handler->startStroke(p0, f0, cur_time); if (!res) return false; @@ -110,7 +112,7 @@ bool StfReader::parseV1(BitReader& br) if (time == 0) { if (handler) { - bool res = handler->endStroke(cur_time); + bool res = handler->endStroke(stroke_time); if (!res) return false; } break; @@ -149,12 +151,13 @@ bool StfReader::parseV1(BitReader& br) pa *= 256 / static_cast<int>(time); f0 += deltaf; + stroke_time += time; + if (handler) { - bool res = handler->strokePoint(p0, f0, cur_time); + bool res = handler->strokePoint(p0, f0, stroke_time); if (!res) return false; } } - } return false; |