Skip to content

Add text last-line alignment modes for "Justify Center", "Justify Right", and "Justify All"#4024

Merged
Keavon merged 5 commits intoGraphiteEditor:masterfrom
Annonnymmousss:feat/justify_proper_align
May 7, 2026
Merged

Add text last-line alignment modes for "Justify Center", "Justify Right", and "Justify All"#4024
Keavon merged 5 commits intoGraphiteEditor:masterfrom
Annonnymmousss:feat/justify_proper_align

Conversation

@Annonnymmousss
Copy link
Copy Markdown
Contributor

Partially closes #2351

Screen.Recording.2026-04-12.at.6.03.41.AM.mov

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive text alignment support, adding Justify Center, Justify Right, and Justify All variants to the existing alignment options. The core logic for text rendering was updated to handle these new modes by calculating specific offsets and inter-character spacing for the final lines of paragraphs. Additionally, the PR ensures that alignment changes are correctly reflected in the UI, the node graph, and the active text editing session. A code improvement was suggested to streamline the conditional logic used for alignment calculations.

Comment thread node-graph/nodes/text/src/text_context.rs Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements expanded text alignment options, including 'Justify Center', 'Justify Right', and 'Justify All'. The changes span the UI property editors, the text tool message handling, and the core text rendering logic. Specifically, the rendering engine now supports calculating horizontal offsets and distributing extra space between words for the last line of a paragraph. A review comment identifies a logic issue in the justification calculation where trailing whitespace is included in the space count, which could prevent text from correctly aligning with the right margin.

Comment thread node-graph/nodes/text/src/text_context.rs Outdated
@Annonnymmousss
Copy link
Copy Markdown
Contributor Author

@cubic-dev

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 12, 2026

@cubic-dev

@Annonnymmousss I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@Keavon Keavon force-pushed the master branch 2 times, most recently from f07c79b to 76938eb Compare April 29, 2026 12:16
@Keavon Keavon changed the title Add JustifyRight, JustifyCentre and JustifyAll Add JustifyRight, JustifyCenter, and JustifyAll May 2, 2026
@Keavon Keavon changed the title Add JustifyRight, JustifyCenter, and JustifyAll Add JustifyRight, JustifyCenter, and JustifyAll text align nodes May 2, 2026
@Keavon Keavon changed the title Add JustifyRight, JustifyCenter, and JustifyAll text align nodes Add JustifyRight, JustifyCenter, and JustifyAll text align modes May 2, 2026
@Keavon Keavon force-pushed the feat/justify_proper_align branch from 0a3797a to fea67e6 Compare May 7, 2026 00:37
@Keavon Keavon changed the title Add JustifyRight, JustifyCenter, and JustifyAll text align modes Add text justification modes for "Justify Center", "Justify Right", and "Justify All" May 7, 2026
@Keavon Keavon changed the title Add text justification modes for "Justify Center", "Justify Right", and "Justify All" Add text last-line alignment modes for "Justify Center", "Justify Right", and "Justify All" May 7, 2026
@Keavon Keavon force-pushed the feat/justify_proper_align branch from 0bca973 to c21cc8f Compare May 7, 2026 02:12
@Keavon Keavon merged commit c0a8241 into GraphiteEditor:master May 7, 2026
10 checks passed
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.

Text alignment, justification, and hyphenation

2 participants