diff options
author | Javier <dev.git@javispedro.com> | 2021-09-19 20:55:17 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2021-09-19 20:55:17 +0200 |
commit | fd2a247a065548422b828d3055729e435a918f42 (patch) | |
tree | a8564151389b7c968b0b1ae133e1f7494a6a3623 /notebookview.cc | |
parent | 419cd14ea25bc1585552bf73f0f29aa62518c175 (diff) | |
download | scribiu-fd2a247a065548422b828d3055729e435a918f42.tar.gz scribiu-fd2a247a065548422b828d3055729e435a918f42.zip |
add InkML export support, fix bug with page layout in notebookview
Diffstat (limited to 'notebookview.cc')
-rw-r--r-- | notebookview.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/notebookview.cc b/notebookview.cc index 06d035b..f8394c0 100644 --- a/notebookview.cc +++ b/notebookview.cc @@ -18,7 +18,7 @@ #include <QtCore/QDebug> #include <QtGui/QResizeEvent> -#include "stftxtexport.h" +#include "stfexporter.h" #include "notebookview.h" #define VIEW_MARGIN 2 @@ -152,10 +152,16 @@ void NotebookView::renderPage(QPainter *painter, int pageNum, const QRectF &targ void NotebookView::exportPageAsTXYP(QIODevice *device, int pageNum, bool relativeTime) { - StfTxtExport writer(_nb); + StfExporter writer(_nb); writer.exportToTXYP(device, pageNum, relativeTime); } +void NotebookView::exportPageAsInkML(QIODevice *device, int pageNum) +{ + StfExporter writer(_nb); + writer.exportToInkML(device, pageNum); +} + void NotebookView::requestPaperReplay(const QString &file, qint64 time) { emit paperReplayRequested(file, time); @@ -294,7 +300,8 @@ void NotebookView::calculateScale() void NotebookView::layoutPages() { - const int numRows = (_pages.size() + 1) / _numColumns; + const int numRows = _pages.size() / _numColumns + + (_pages.size() % _numColumns > 0 ? 1 : 0); const QSizeF pageSpace( _maxPageSize.width() + PAGE_SEPARATION, _maxPageSize.height() + PAGE_SEPARATION); |