textPadding / resizeBorders confusion

Hey

Just a minor thing I noticed. I was playing with the new textPadding capabilities (awesome btw, good to get this much control over padding), and had a bit of a head scratching moment. It took a while to notice that textPadding works differently to resizeBorders.

resize borders … x = North, y = West, z = East, w = South
padding … x = East, y = West, z = North, w = South

Is there a good reason for this? Apologies if it’s been explained elsewhere, but I couldn’t see anything.

RR

Oh, by the way, related. There is another issue in Button.setStyles(). The style name “Button” is being used, meaning of course it never gets the new padding.

[java]
//setTextPaddingByKey(“Button”,“textPadding”);
setTextPaddingByKey(styleName,“textPadding”);
[/java]

@rockfire said: Hey

Just a minor thing I noticed. I was playing with the new textPadding capabilities (awesome btw, good to get this much control over padding), and had a bit of a head scratching moment. It took a while to notice that textPadding works differently to resizeBorders.

resize borders … x = North, y = West, z = East, w = South
padding … x = East, y = West, z = North, w = South

Is there a good reason for this? Apologies if it’s been explained elsewhere, but I couldn’t see anything.

RR

Oh, by the way, related. There is another issue in Button.setStyles(). The style name “Button” is being used, meaning of course it never gets the new padding.

[java]
//setTextPaddingByKey(“Button”,“textPadding”);
setTextPaddingByKey(styleName,“textPadding”);
[/java]

Sorry for any delay in response… not only did my network card go south… then our service through CenturyLink went south >.<

The reason was:

Originally, I thought I would follow HTML/CSS rules…
Later, I thought… man, I f’ing hate CSS borders ordering.
Now, internally it’s a mess, however… I’m trying to figure out a method of resolving this without making anything effect the user.

I haven’t had a change to resolve anything over the last couple days, so I will add this to the list of setStyle and make sure it gets resolved properly!

@t0neg0d said: Sorry for any delay in response... not only did my network card go south.... then our service through CenturyLink went south >.<

The reason was:

Originally, I thought I would follow HTML/CSS rules…
Later, I thought… man, I f’ing hate CSS borders ordering.
Now, internally it’s a mess, however… I’m trying to figure out a method of resolving this without making anything effect the user.

I haven’t had a change to resolve anything over the last couple days, so I will add this to the list of setStyle and make sure it gets resolved properly!

Heh, glad you are back online! Ahhh I see, one of those situations XD

Not a problem of course now I know it’s supposed to be that way (except maybe Javadocs on all related methods might help a little). In fact I think i got that ordering incorrect above if you are saying you used css rules for resizeBorders (which is clockwise starting at north iirc?). That could explain some oddness with my layout code.

I am not sure how that could be made consistent without either breaking stuff or getting overly complex, although I guess textPadding is relatively new so is probably currently used least.

My only suggestion might to be add another 4-value type that could be instead of Vector4f. So in the style XML you have choice of float (one-for-all), Vector4f (current behaviour) or say “Insets” (new consistent behaviour).

Good luck with that one :\