Skip to Main Content

Java SE (Java Platform, Standard Edition)

Aligning transformed Text (and other shapes) inside StackFrame

NikolayArtamonovSep 22 2013 — edited Sep 22 2013

Good day, guys! I have StackPane and scaled (enlarged with scaleX and scaleY properties) Text node inside pane. When text aligned to center of pane (Pic. 1) there are no issues. But when I try to align to left, right, or any other sides or corners then text positioned outside of pane (Pic. 2). How can I fix it? Text have TextBoundsType.VISUAL bounds. Thanks!

Link to image...

Pic. 1. Grey text aligned to center of stack pane.

StackPane.setAlignment(Pos.CENTER)

Link to image...

Pic. 2. Grey text aligned to left side of stack pane.

StackPane.setAlignment(Pos.CENTER_LEFT)

This post has been answered by MoC on Sep 22 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2013
Added on Sep 22 2013
6 comments
422 views