Skip to content

fix(render): lay out right-to-left documents from the right edge - #31

Open
hamza39460 wants to merge 1 commit into
DoctorinaAI:masterfrom
hamza39460:fix/rtl-layout
Open

hamza39460 wants to merge 1 commit into
DoctorinaAI:masterfrom
hamza39460:fix/rtl-layout

Conversation

@hamza39460

Copy link
Copy Markdown

With MarkdownThemeData.textDirection set to TextDirection.rtl, every block still positioned its content from the left: short paragraphs and headings hugged the left edge, list bullets and quote/alert bars sat on the left, and table columns ran left to right.

Blocks now mirror their x positions for RTL, and link taps and selection use the same mirrored positions. MarkdownPainter honors minWidth, so tight constraints align RTL content to the full width, and under loose constraints it lays blocks out again at the final content width. Code blocks stay LTR. Selection handles follow a right-to-left Directionality.

Left-to-right layout is unchanged.

With MarkdownThemeData.textDirection set to TextDirection.rtl, every block
still positioned its content from the left: short paragraphs and headings
hugged the left edge, list bullets and quote/alert bars sat on the left, and
table columns ran left to right.

Blocks now mirror their x positions for RTL, and link taps and selection use
the same mirrored positions. MarkdownPainter honors minWidth, so tight
constraints align RTL content to the full width, and under loose constraints
it lays blocks out again at the final content width. Code blocks stay LTR.
Selection handles follow a right-to-left Directionality.

Left-to-right layout is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 this pull request may close these issues.

1 participant