From 1fd6705f9d4e239f9501f773b57beee5f8506df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 17 Apr 2018 13:29:01 +0200 Subject: [PATCH] [poincare] Fix HorizontalLayout vertical navigation. Change-Id: Ia8fd862f24a99bcd6d0f5085b008f572ba859f69 --- poincare/src/layout/horizontal_layout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poincare/src/layout/horizontal_layout.cpp b/poincare/src/layout/horizontal_layout.cpp index aa0a30053..e7597ed68 100644 --- a/poincare/src/layout/horizontal_layout.cpp +++ b/poincare/src/layout/horizontal_layout.cpp @@ -428,9 +428,9 @@ bool HorizontalLayout::moveVertically(ExpressionLayout::VerticalDirection direct } } } - /* If the cursor is Lefit or Right of the HorizontalLayout, try moving it up + /* If the cursor is Left or Right of the HorizontalLayout, try moving it up * from its extremal child. */ - if (cursor->pointedExpressionLayout() == this && previousLayout == nullptr) { + if (cursor->pointedExpressionLayout() == this && previousLayout == nullptr && numberOfChildren() > 0) { int indexOfChildToCheck = cursor->position() == ExpressionLayoutCursor::Position::Left ? 0 : numberOfChildren() - 1; if (tryMoveVerticallyFromAnotherLayout(editableChild(indexOfChildToCheck), cursor->position(), direction, cursor, shouldRecomputeLayout, previousLayout)) { return true;