mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps/sequence/sequence] Do not memoize nameLayout
Fixes the following bug: In the graph tab of the Sequence app, compute the sum of the terms of a sequence from 1 to 9 and then from 1 to 10. The Layout is memoized after the first time and mispositioned the second time since it is not recomputed.
This commit is contained in:
committed by
LeaNumworks
parent
c1215063ee
commit
fccd72b757
@@ -28,7 +28,6 @@ void Sequence::tidy() {
|
||||
m_firstInitialCondition.tidyName();
|
||||
m_secondInitialCondition.tidy();
|
||||
m_secondInitialCondition.tidyName();
|
||||
m_nameLayout = Layout();
|
||||
}
|
||||
|
||||
Sequence::Type Sequence::type() const {
|
||||
@@ -81,13 +80,10 @@ void Sequence::setInitialRank(int rank) {
|
||||
}
|
||||
|
||||
Poincare::Layout Sequence::nameLayout() {
|
||||
if (m_nameLayout.isUninitialized()) {
|
||||
m_nameLayout = HorizontalLayout::Builder(
|
||||
CodePointLayout::Builder(fullName()[0], KDFont::SmallFont),
|
||||
VerticalOffsetLayout::Builder(CodePointLayout::Builder(symbol(), KDFont::SmallFont), VerticalOffsetLayoutNode::Position::Subscript)
|
||||
);
|
||||
}
|
||||
return m_nameLayout;
|
||||
return HorizontalLayout::Builder(
|
||||
CodePointLayout::Builder(fullName()[0], KDFont::SmallFont),
|
||||
VerticalOffsetLayout::Builder(CodePointLayout::Builder(symbol(), KDFont::SmallFont), VerticalOffsetLayoutNode::Position::Subscript)
|
||||
);
|
||||
}
|
||||
|
||||
bool Sequence::isDefined() {
|
||||
|
||||
@@ -24,8 +24,9 @@ public:
|
||||
DoubleRecurrence = 2
|
||||
};
|
||||
Sequence(Ion::Storage::Record record = Record()) :
|
||||
Function(record),
|
||||
m_nameLayout() {}
|
||||
Function(record)
|
||||
{
|
||||
}
|
||||
I18n::Message parameterMessageName() const override;
|
||||
CodePoint symbol() const override { return 'n'; }
|
||||
void tidy() override;
|
||||
@@ -153,7 +154,6 @@ private:
|
||||
DefinitionModel m_definition;
|
||||
FirstInitialConditionModel m_firstInitialCondition;
|
||||
SecondInitialConditionModel m_secondInitialCondition;
|
||||
Poincare::Layout m_nameLayout;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user