API review: RT-27762: Text not centered vertically in bounds for windows default 12px
Richard Bair
Richard.Bair at oracle.com
Tue Feb 26 09:28:09 PST 2013
I probably would go with LOGICAL_VERTICAL_CENTER in this case (longer but code-complete is my friend).
What do you think?
Richard
On Feb 25, 2013, at 4:48 PM, Felipe Heidrich <felipe.heidrich at oracle.com> wrote:
> Hi,
>
> In order to fix RT-27762 Jasper and I have been experiment with a new type of text bounds.
>
> What this new type does is to change the metrics of the node so that the pixel space above the bellow the cap height are the same (either by increasing the descent, or the internal leading).
> We are do this to improve the visual appearance of UI components holding vertically centered text, such buttons, labels, and others.
>
> New API proposal:
>
> TextBoundsType#LOGICAL_V_CENTER:
> /**
> * Use logical vertical centered bounds as the basis for calculating the bounds.
> * <p>
> * This bounds type is typically used to center {@code Text} nodes vertically
> * within the bounds of its parent.
> */
> LOGICAL_V_CENTER
>
> Here is a screenshot of new mode in action (hopping the mailing allows attachments):
> Left is regular logical bounds, right is logical v center bounds, you need ninja eyes to see the difference:
>
> <RT-27762.png>
>
> Regards
> Felipe
More information about the openjfx-dev
mailing list