mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare] Fix LayoutNode::canBeOmittedMultiplicationRightFactor
This commit is contained in:
@@ -28,6 +28,7 @@ public:
|
||||
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
|
||||
bool isChar() const override { return true; }
|
||||
bool isCollapsable(int * numberOfOpenParenthesis, bool goingLeft) const override;
|
||||
bool canBeOmittedMultiplicationRightFactor() const override;
|
||||
|
||||
// TreeNode
|
||||
size_t size() const override { return sizeof(CharLayoutNode); }
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
|
||||
bool mustHaveLeftSibling() const override { return true; }
|
||||
bool isVerticalOffset() const override { return true; }
|
||||
bool canBeOmittedMultiplicationRightFactor() const override { return false; }
|
||||
|
||||
// TreeNode
|
||||
size_t size() const override { return sizeof(VerticalOffsetLayoutNode); }
|
||||
|
||||
@@ -65,6 +65,13 @@ bool CharLayoutNode::isCollapsable(int * numberOfOpenParenthesis, bool goingLeft
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CharLayoutNode::canBeOmittedMultiplicationRightFactor() const {
|
||||
if (m_char == '!') {
|
||||
return false;
|
||||
}
|
||||
return LayoutNode::canBeOmittedMultiplicationRightFactor();
|
||||
}
|
||||
|
||||
// Sizing and positioning
|
||||
KDSize CharLayoutNode::computeSize() {
|
||||
return m_font->glyphSize();
|
||||
|
||||
@@ -123,7 +123,7 @@ bool LayoutNode::canBeOmittedMultiplicationRightFactor() const {
|
||||
* functions changes, it might not be the case anymore so make sure to modify
|
||||
* canBeOmittedMultiplicationRightFactor if needed. */
|
||||
int numberOfOpenParentheses = 0;
|
||||
return isCollapsable(&numberOfOpenParentheses, false) && !isVerticalOffset();
|
||||
return isCollapsable(&numberOfOpenParentheses, false);
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
Reference in New Issue
Block a user