Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still curious how changing 5 -> 0.5 results in halving of the spacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damithc
The
spacing
attribute in the HBox only affects the horizontal space between the direct child elements of the HBox, not the spacing within the content of those child elements. In your case, the HBox contains two Label elements: one for the ID and one for the name. Thespacing
attribute adjusts the space between these two Label elements, not the space between characters within the text of each Label.HBox Spacing: The
spacing="0.5"
in the HBox affects the space between its direct children, which are the Label elements withfx:id="id"
andfx:id="name"
. This means it reduces the space between the ID and the name labels.Text Content: The spacing within the text content of a Label (such as spaces between words or characters) is not affected by the HBox’s
spacing
attribute. This spacing is managed by the text rendering engine and the font metrics, which are not controlled by the HBox.Effect on Layout:
0.5
) decreases the space between the two Label elements, making them appear closer together.In summary, the
spacing
attribute in the HBox controls the space between its child elements (the Labels), not the space within the text content of those child elements. This is why changing the spacing value only affects the distance between the ID and name labels, not the spacing within the words in the labels.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is why the spacing between words is fine but the issue was only between the index and name
(Index) [SPACE] (name)
Also the changing of the value to 0.5 is not by some exact form of calculation or formula,
it was more through reducing the value and seeing the reflected change in the UI until the reduction resulted in what looked like a halving of the space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was thinking if i should add this to the commit message body but i didnt want it to be too long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can mention it briefly i.e., you are adjusting the spacing attribute, which determines the spacing between child elements, and the value 0.5 seems to produce the desired gap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay will do it @damithc