mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.14k stars 235 forks source link

Extended shape rounding #599

Open husker-dev opened 4 years ago

husker-dev commented 4 years ago

I think it would be nice if there was an opportunity to set width (x) and height (y) of corner rounding.

image

I made an example to rounding value width = 4 and height= 7:

image

In XML it might look like this:

<WebShape round="{4,7},0,0,0" />

Or for every corner:

<WebShape round="{4,7}" />
mgarin commented 4 years ago

It's a good enhancement for one of the future updates for sure. I'll put it on v1.2.13 for now, but it will probably take some time until I get to it.

Besides the XML syntax for it - there are quite a few tricky things with current shadow generation which will get affected by this and will need to be taken into account.

mgarin commented 4 years ago

Also regarding syntax - maybe it is worth mirroring CSS: https://www.sitepoint.com/setting-css3-border-radius-with-slash-syntax/

So basically something like this:

<WebShape round="4/7,0,0,0" />

Should be pretty convenient considering it is int values only.