[escher] Increase TextField::maxBufferSize

In order to be able to write a 10*10 adjacency matrix
This commit is contained in:
Léa Saviot
2019-03-04 16:54:32 +01:00
committed by Émilie Feral
parent 1c62550649
commit a88a1bcbef
2 changed files with 6 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ protected:
bool privateHandleMoveEvent(Ion::Events::Event event, bool * shouldRecomputeLayout);
private:
constexpr static int k_maxNumberOfLayouts = 152;
constexpr static int k_maxNumberOfLayouts = 220;
static_assert(k_maxNumberOfLayouts == TextField::maxBufferSize(), "Maximal number of layouts in a layout field should be equal to max number of char in text field");
void scrollRightOfLayout(Poincare::Layout layoutR);
void scrollToBaselinedRect(KDRect rect, KDCoordinate baseline);

View File

@@ -63,8 +63,11 @@ protected:
* lengths can reach 70 (ie
* [[1.234567e-123*e^(1.234567e-123*i), 1.234567e-123*e^(1.234567e-123*i)]]).
* In order to be able to record those output text, k_maxBufferSize must be
* over 70. */
constexpr static int k_maxBufferSize = 152;
* over 70.
* Furthermore, we want ot be able to write an adjacency matrix of size 10
* so we need at least 2 brackets + 10 * (2 brackets + 10 digits + 9 commas)
* = 212 characters. */
constexpr static int k_maxBufferSize = 220;
private:
void layoutSubviews() override;
KDRect glyphFrameAtPosition(const char * buffer, const char * position) const override;