mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 04:00:02 +02:00
[escher] [apps] Get rid of magic numbers
Change-Id: Iad192d24324dda37b3d739830cc8ead7a032e22f
This commit is contained in:
@@ -42,14 +42,14 @@ bool ScrollableExpressionView::rightViewIsInvisible() {
|
||||
bool ScrollableExpressionView::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::Right && rightViewIsInvisible()) {
|
||||
KDCoordinate rightSpace = m_expressionView.bounds().width() - m_manualScrolling - bounds().width();
|
||||
KDCoordinate scrollAdd = rightSpace > 10 ? 10 : rightSpace;
|
||||
KDCoordinate scrollAdd = rightSpace > Metric::ScrollStep ? Metric::ScrollStep : rightSpace;
|
||||
m_manualScrolling += scrollAdd;
|
||||
setContentOffset(KDPoint(m_manualScrolling, 0));
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::Left && m_manualScrolling > 0) {
|
||||
KDCoordinate leftSpace = m_manualScrolling;
|
||||
KDCoordinate scrollSubstract = leftSpace > 10 ? 10 : leftSpace;
|
||||
KDCoordinate scrollSubstract = leftSpace > Metric::ScrollStep ? Metric::ScrollStep : leftSpace;
|
||||
m_manualScrolling -= scrollSubstract;
|
||||
setContentOffset(KDPoint(m_manualScrolling, 0));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user