faisal-kabir / math_text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

height of TexView inccorrect

pleasehelpalex opened this issue · comments

Question: Are you using the latest version of flutter_tex package? pub package
Answer:

flutter_tex:
git:
url: https://github.com/faisal-kabir/math_text.git
ref: master

Question: If you are looking for a feature, have you watched the Demo Video and gone through the examples folder?
Answer:
yes

Most formulas are rendering fine. In some, the widget height appears to be incorrect (part of the rendered formula is cut off.

child: TeXView(
renderingEngine: renderingEngine,
child: TeXViewDocument(
r'( f(x)=\left{\begin{array}{ll}x^{2} & \text { if } x<0 \ 2 x & \text { if } x \geq 0\end{array}\right. )',
),
style: const TeXViewStyle(
margin: TeXViewMargin.all(5),
border: TeXViewBorder.all(
TeXViewBorderDecoration(
borderColor: Colors.blue,
borderStyle: TeXViewBorderStyle.solid,
borderWidth: 5),
),
),
),
IMG-20220731-WA0013

In the above texview, as can be seen in the attached image (last equation), the height is insufficient.

I'm new to flutter! Thanks for your great fork it is helping me loads. I hope to be able to commit soon.

My apologies! Everything is working fine. The problem was that I had used inline math instead of equation. Changing from single dollar sign $ $ to double dollar sign $$ $$ fixes the issue (on iOS). I haven't checked on android yet but am sure this was the issue!

Yes, I cloned the latest version code from fluter_tex.

Not only you, many people created the same issue in this package about this space issue, even I also created the same issue but I did not get any solution.
The way I solved the problem is that on the page where I used flutter_tex, I tried to reduce call setState() or UI rebuild on that page, and then my problem was solved in my whole project.

So if you want to solve the space issue then you need to reduce call UI rebuild.

My apologies! Everything is working fine. The problem was that I had used inline math instead of equation. Changing from single dollar sign $ $ to double dollar sign $$ $$ fixes the issue (on iOS). I haven't checked on android yet but am sure this was the issue!

Thanks a lot!