mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 00:30:46 +01:00
[poincare] Do not insert an empty base for power layouts.
This should be done only if the power is added to an horizontal layout with no child. Change-Id: I5f2f501420da127a2ed42d2b01042ec5968f488f
This commit is contained in:
@@ -252,26 +252,15 @@ bool ExpressionLayoutCursor::privateShowHideEmptyLayoutIfNeeded(bool show) {
|
||||
}
|
||||
|
||||
bool ExpressionLayoutCursor::baseForNewPowerLayout() {
|
||||
// Returns true if the layout on the left of the pointed layout is suitable to
|
||||
// be the base of a new power layout.
|
||||
int numberOfOpenParenthesis = 0;
|
||||
if (m_position == Position::Right
|
||||
&& m_pointedExpressionLayout->isCollapsable(&numberOfOpenParenthesis, true))
|
||||
/* Returns true if the layout on the left of the pointed layout is suitable to
|
||||
* be the base of a new power layout: the base layout should be anything but
|
||||
* an horizontal layout with no child. */
|
||||
if (m_pointedExpressionLayout->isHorizontal()
|
||||
&& m_pointedExpressionLayout->numberOfChildren() == 0)
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if (m_pointedExpressionLayout->parent() != nullptr) {
|
||||
int indexInParent = m_pointedExpressionLayout->parent()->indexOfChild(m_pointedExpressionLayout);
|
||||
if (m_position == Position::Left
|
||||
&& m_pointedExpressionLayout->parent()->isHorizontal()
|
||||
&& indexInParent > 0
|
||||
&& (m_pointedExpressionLayout->editableParent()->editableChild(indexInParent-1)->isEmpty()
|
||||
|| m_pointedExpressionLayout->editableParent()->editableChild(indexInParent-1)->isCollapsable(&numberOfOpenParenthesis, true)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
KDCoordinate ExpressionLayoutCursor::pointedLayoutHeight() {
|
||||
|
||||
Reference in New Issue
Block a user