znjameswu / flutter_math

Math rendering and editing in pure Flutter.
https://znjameswu.github.io/flutter_math_demo/
Apache License 2.0
123 stars 52 forks source link

A RenderLine overflowed #28

Closed Skyost closed 3 years ago

Skyost commented 3 years ago

Hello,

I'm testing your package from the master branch (because I want to give a try to the new line break feature) and I still have some overflow exceptions :

Stacktrace ``` ======== Exception caught by rendering library ===================================================== The following assertion was thrown during layout: A RenderLine overflowed by 19 pixels on the right. The relevant error-causing widget was: Math file:///D:/Hugo/Projets/Flutter/bacomathiques/lib/pages/html/widgets/math_widget.dart:20:46 The edge of the RenderLine that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderLine. Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderLine to fit within the available space instead of being sized to their natural size. This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView. The specific RenderLine in question is: RenderLine#b574a relayoutBoundary=up28 OVERFLOWING ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=323.4, 0.0<=h<=Infinity) ... size: Size(323.4, 36.2) ... crossAxisAlignment: baseline ... textDirection: ltr ... textBaseline: alphabetic ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤ ==================================================================================================== ```

See it in action :

Skyost commented 3 years ago

Here's another example :

Stacktrace ``` ======== Exception caught by rendering library ===================================================== The following assertion was thrown during layout: A RenderLine overflowed by 94 pixels on the right. The relevant error-causing widget was: Math file:///D:/Hugo/Projets/Flutter/bacomathiques/lib/pages/html/widgets/math_widget.dart:20:46 The edge of the RenderLine that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderLine. Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderLine to fit within the available space instead of being sized to their natural size. This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView. The specific RenderLine in question is: RenderLine#e7b4f relayoutBoundary=up28 OVERFLOWING ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=323.4, 0.0<=h<=Infinity) ... size: Size(323.4, 35.1) ... crossAxisAlignment: baseline ... textDirection: ltr ... textBaseline: alphabetic ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤ ==================================================================================================== ```
Skyost commented 3 years ago

Oh, I wasn't aware of this and I was not following the recommendations. Sorry for this issue then 😄