Mercurial > hg > syntilista
changeset 125:6e2d26e7a0b4
Add few helpers.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 10 Jul 2017 13:56:04 +0300 |
parents | a063cb8a171b |
children | b51cee929416 |
files | src/main.cpp src/main.h |
diffstat | 2 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main.cpp Mon Jul 10 12:52:35 2017 +0300 +++ b/src/main.cpp Mon Jul 10 13:56:04 2017 +0300 @@ -672,8 +672,7 @@ // Check for end of page // KLUDGE for now - if (getPageInfo && - ctx.m_pos.y() + (ctx.boundRect().height() * 4) >= 1300.0f / 2.0f) + if (getPageInfo && ctx.lfq(10) >= 1300.0f) { if (nline > pinfo.nlinesPerPage) pinfo.nlinesPerPage = nline;
--- a/src/main.h Mon Jul 10 12:52:35 2017 +0300 +++ b/src/main.h Mon Jul 10 13:56:04 2017 +0300 @@ -316,11 +316,21 @@ m_pos.setY(m_pos.y() + boundRect().height() + yadd); } + qreal lfq(qreal yadd) + { + return m_pos.y() + boundRect().height() + yadd; + } + void lf() { lf(m_lf_add); } + qreal lfq() + { + return m_pos.y() + boundRect().height() + m_lf_add; + } + void setPos(const QPointF &pos) { m_pos = pos;