From b3f1297a37d5bfe6669c22331b6e7f0c19017a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 2 Nov 2016 09:31:42 +0100 Subject: [PATCH] [apps/calculation] Correct error in resetting the scroll in pretty print view Change-Id: I1a226cdf9d66e032d2cea143b779e11d996220a7 --- apps/calculation/pretty_print_view.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/calculation/pretty_print_view.cpp b/apps/calculation/pretty_print_view.cpp index 24bdd4760..2664a3e48 100644 --- a/apps/calculation/pretty_print_view.cpp +++ b/apps/calculation/pretty_print_view.cpp @@ -30,7 +30,8 @@ KDSize PrettyPrintView::minimalSizeForOptimalDisplay() { } void PrettyPrintView::reloadCell() { - setContentOffset({0, 0}); + m_manualScrolling = 0; + setContentOffset(KDPoint(m_manualScrolling, 0)); } bool PrettyPrintView::rightViewIsInvisible() { @@ -44,7 +45,7 @@ bool PrettyPrintView::handleEvent(Ion::Events::Event event) { KDCoordinate rightSpace = m_expressionView.bounds().width() - m_manualScrolling - bounds().width(); KDCoordinate scrollAdd = rightSpace > 10 ? 10 : rightSpace; m_manualScrolling += scrollAdd; - setContentOffset({m_manualScrolling, 0}); + setContentOffset(KDPoint(m_manualScrolling, 0)); return true; } return false; @@ -53,7 +54,7 @@ bool PrettyPrintView::handleEvent(Ion::Events::Event event) { KDCoordinate leftSpace = m_manualScrolling; KDCoordinate scrollSubstract = leftSpace > 10 ? 10 : leftSpace; m_manualScrolling -= scrollSubstract; - setContentOffset({m_manualScrolling, 0}); + setContentOffset(KDPoint(m_manualScrolling, 0)); return true; } return false;