diff --git a/apps/sequence/sequence.h b/apps/sequence/sequence.h index e24847d68..359118379 100644 --- a/apps/sequence/sequence.h +++ b/apps/sequence/sequence.h @@ -43,7 +43,7 @@ public: private: constexpr static int k_maxRecurrentRank = 10000; constexpr static float k_maxNumberOfTermsInSum = 100000.0f; - constexpr static size_t k_dataLengthInBytes = 3*TextField::maxBufferSize()*sizeof(char)+2; + constexpr static size_t k_dataLengthInBytes = 3*TextField::maxBufferSize()*sizeof(char); static_assert((k_dataLengthInBytes & 0x3) == 0, "The sequence data size is not a multiple of 4 bytes (cannot compute crc)"); // Assert that dataLengthInBytes is a multiple of 4 char symbol() const override; Type m_type; diff --git a/apps/shared/function.h b/apps/shared/function.h index 1acdae8ef..f03d75fb6 100644 --- a/apps/shared/function.h +++ b/apps/shared/function.h @@ -32,7 +32,7 @@ public: protected: mutable Poincare::Expression * m_expression; private: - constexpr static size_t k_dataLengthInBytes = TextField::maxBufferSize()*sizeof(char)+2; + constexpr static size_t k_dataLengthInBytes = TextField::maxBufferSize()*sizeof(char); static_assert((k_dataLengthInBytes & 0x3) == 0, "The function data size is not a multiple of 4 bytes (cannot compute crc)"); // Assert that dataLengthInBytes is a multiple of 4 virtual char symbol() const = 0; char m_text[TextField::maxBufferSize()]; diff --git a/escher/include/escher/text_field.h b/escher/include/escher/text_field.h index 638868cb2..dfeb7ab41 100644 --- a/escher/include/escher/text_field.h +++ b/escher/include/escher/text_field.h @@ -64,7 +64,12 @@ protected: KDCoordinate charWidth(); void deleteCharPrecedingCursor(); View * subviewAtIndex(int index) override; - constexpr static int k_maxBufferSize = 50; + /* In some app (ie Calculation), text fields record expression results whose + * 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 = 100; private: int numberOfSubviews() const override; void layoutSubviews() override;