Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow in cases environment #17

Closed
Skyost opened this issue Nov 30, 2020 · 8 comments · Fixed by #22
Closed

Overflow in cases environment #17

Skyost opened this issue Nov 30, 2020 · 8 comments · Fixed by #22

Comments

@Skyost
Copy link
Contributor

Skyost commented Nov 30, 2020

Hey,

First, thank you for this great plugin ! I'm currently trying to implement it in my app alongside flutter_widget_from_html_core. But everytime I'm using the cases environment, I get a RenderLine overflowed of 16 pixels error.

(the second overflow error is due to #8)

The Math widget is inserted as an inline widget and its parent is a Column widget.

@znjameswu
Copy link
Owner

Thank you for your feedback. I'll check that. Possibly missing some tests.

Meanwhile as a suggestion, for display equation overflow caused by #8, you can always wrap it inside a scrollable widget.

@Skyost
Copy link
Contributor Author

Skyost commented Dec 1, 2020

Meanwhile as a suggestion, for display equation overflow caused by #8, you can always wrap it inside a scrollable widget.

Yes, that's what I figured out too. But the thing is that I don't like when these blocks are scrollable, because Text widgets do not wrap. For example,

Not in a scrollable widget :

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nunc gravida ex eu velit sagittis laoreet. Pellentesque placerat
urna ut tempus molestie.

Morbi feugiat ornare orci sed pharetra. Aliquam elit ligula,
bibendum sit amet mi eget, porttitor lobortis nisi. Etiam mattis
tempor pellentesque.

In a scrollable widget :

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc gravida ex eu velit sagittis laoreet. Pellentesque placerat urna ut tempus molestie.

Morbi feugiat ornare orci sed pharetra. Aliquam elit ligula, bibendum sit amet mi eget, porttitor lobortis nisi. Etiam mattis tempor pellentesque.

(and I prefer the first one, but I also think I will have to implement the second one.) It would be great if Flutter allowed us to detect when an overflow occurs (so that I can use scrollable widgets only when needed), but I don't think it's possible, sadly 😄

@znjameswu
Copy link
Owner

znjameswu commented Dec 1, 2020

It is a combination of corner cases inside RenderLine layout logic and parsing flaws for cases blocks without a second column. I'll fix it sometime later this week.

This overflow is only painted inside a debug environment. The positioning of all the elements is still correct. It should not have any impact in profile and release mode.

@Skyost
Copy link
Contributor Author

Skyost commented Dec 1, 2020

Great @znjameswu !

Skyost added a commit to Skyost/Bacomathiques that referenced this issue Dec 3, 2020
Cela pouver causer des ralentissements sur certains appareils. Il reste à attendre les mises à jours prochaines de flutter_widget_from_html_core (cf. daohoangson/flutter_widget_from_html#365) et de flutter_math (cf. znjameswu/flutter_math#17) avec la release.
@Skyost
Copy link
Contributor Author

Skyost commented Dec 8, 2020

Hey @znjameswu, do you have any news about this one ?

@znjameswu
Copy link
Owner

Hey @znjameswu, do you have any news about this one ?

Sorry I'm having quite a burnout recently. I will work on this one as soon as possible.

@Skyost
Copy link
Contributor Author

Skyost commented Dec 9, 2020

Take your time @znjameswu, I know what it is to be completely overwhelmed with work.

@Skyost
Copy link
Contributor Author

Skyost commented Dec 18, 2020

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants