diff --git a/node-graph/nodes/text/src/text_context.rs b/node-graph/nodes/text/src/text_context.rs index 7934feb885..56d5750e6c 100644 --- a/node-graph/nodes/text/src/text_context.rs +++ b/node-graph/nodes/text/src/text_context.rs @@ -81,7 +81,10 @@ impl TextContext { let mut layout: Layout<()> = builder.build(text); layout.break_all_lines(typesetting.max_width.map(|mw| mw as f32)); - layout.align(typesetting.max_width.map(|max_w| max_w as f32), typesetting.align.into(), AlignmentOptions::default()); + + //To make text alignment work when the max width is disabled + let alignment_width = typesetting.max_width.map(|max_w| max_w as f32).or(Some(layout.full_width())); + layout.align(alignment_width, typesetting.align.into(), AlignmentOptions::default()); Some(layout) }