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

RTL bug #11

Closed
sm2017 opened this issue Dec 2, 2020 · 2 comments · Fixed by #17
Closed

RTL bug #11

sm2017 opened this issue Dec 2, 2020 · 2 comments · Fixed by #17

Comments

@sm2017
Copy link
Contributor

sm2017 commented Dec 2, 2020

I figured out that we have bug in RTL mode

It tried to fix it, but failed , I think the bug is here https://github.com/jonataslaw/readmore/blob/master/lib/readmore.dart#L148-L152

I changed it to, it works better but not fixed

          if (textDirection == TextDirection.rtl) {
            final pos = textPainter.getPositionForOffset(Offset(
              linkSize.width,
              textSize.height,
            ));
            endIndex = textPainter.getOffsetBefore(pos.offset);
            // endIndex = textPainter.getOffsetAfter(pos.offset); I tried getOffsetAfter too
          } else {
            final pos = textPainter.getPositionForOffset(Offset(
              textSize.width - linkSize.width,
              textSize.height,
            ));
            endIndex = textPainter.getOffsetBefore(pos.offset);
          }

@jonataslaw can you take a look?

@sm2017
Copy link
Contributor Author

sm2017 commented Dec 5, 2020

@jonataslaw Can you please reply?

@sm2017
Copy link
Contributor Author

sm2017 commented Apr 4, 2021

@jonataslaw Please please reply

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.

1 participant