How to draw a rectangle with only two rounded corners?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: How to draw a rectangle with only two rounded corners?
Further to this, i got in touch with the author (Andreas Strauch) via facebook and he's generously agreed to share a new version...
Re: How to draw a rectangle with only two rounded corners?
The author, Andreas Strauch, has kindly been in touch and confirmed his widget CustomRect is released as openSource.
If used in a project please do acknowledge him. It goes without saying, but he's asked that the widget itself is not exploited financially.
He's kindly shared the source with me and i've mirrored this on MediaFire.com
Link : https://www.mediafire.com/file/vo7a7rs0 ... w.zip/file
Use the extension manager (Tools menu -> extension manager -> + ) to install.
After installation, you get a new icon in the Tools palette:
Double-click (or drag/drop) this to add a new customRect to your card
Invoke the properties panel (eg double-click) and adjust each corner as needed
I've been using this for quite a while and it's been rock solid - I can only thank Andreas for creating this and re-sharing it. Hopefully others will find this useful as well...
If used in a project please do acknowledge him. It goes without saying, but he's asked that the widget itself is not exploited financially.
He's kindly shared the source with me and i've mirrored this on MediaFire.com
Link : https://www.mediafire.com/file/vo7a7rs0 ... w.zip/file
Use the extension manager (Tools menu -> extension manager -> + ) to install.
After installation, you get a new icon in the Tools palette:
Double-click (or drag/drop) this to add a new customRect to your card
Invoke the properties panel (eg double-click) and adjust each corner as needed
I've been using this for quite a while and it's been rock solid - I can only thank Andreas for creating this and re-sharing it. Hopefully others will find this useful as well...
Re: How to draw a rectangle with only two rounded corners?
Hi Stam,
I agree that Andreas Strauch's CustomRect is a nice and versatile widget. The only advantage compared to Ralph Bitter's Universal Button is that you can change the radius of every corner individually. Universal button only lets you change the corner radius for all corners that are rounded at once.
However Universal Button has some advantages.
1. It is MIT licensed. (as long as you include the license somewhere in your project you are free to do what you want, that includes using it in commercial applications.)
2. It includes an API i.e. you can find its properties in the LC dictionary (I know it is tedious to write them but I think a widget for public consumption needs and API which could be an inline documentation in the LCB file from which the API is extracted automatically for the dictionary)
3. I has not some of the minor drawing issues that CustomRect has.
Kind regards
Bernd
I agree that Andreas Strauch's CustomRect is a nice and versatile widget. The only advantage compared to Ralph Bitter's Universal Button is that you can change the radius of every corner individually. Universal button only lets you change the corner radius for all corners that are rounded at once.
However Universal Button has some advantages.
1. It is MIT licensed. (as long as you include the license somewhere in your project you are free to do what you want, that includes using it in commercial applications.)
2. It includes an API i.e. you can find its properties in the LC dictionary (I know it is tedious to write them but I think a widget for public consumption needs and API which could be an inline documentation in the LCB file from which the API is extracted automatically for the dictionary)
3. I has not some of the minor drawing issues that CustomRect has.
Kind regards
Bernd
-
- Posts: 5
- Joined: Fri Nov 19, 2021 1:12 pm
Re: How to draw a rectangle with only two rounded corners?
Hello together
I am the author of customRect and welcome any comments with constructive criticism.
Regarding the widget by Ralph Bitter:
I know it and it has a completely different approach than my widget. His widget is based on buttons, mine on the other hand on a graphical representation.
As for the matter of the licence... it's getting too stupid for me to go into discussions now, so I'll make short work of it: It's now a Puplic Domain and the source will be available for everyone on Github from Sunday. Full stop.
As for the API. Since I originally wrote the widget just for myself, I didn't see any need... So if you want to... do your thing....
have a nice day
I am the author of customRect and welcome any comments with constructive criticism.
Regarding the widget by Ralph Bitter:
I know it and it has a completely different approach than my widget. His widget is based on buttons, mine on the other hand on a graphical representation.
As for the matter of the licence... it's getting too stupid for me to go into discussions now, so I'll make short work of it: It's now a Puplic Domain and the source will be available for everyone on Github from Sunday. Full stop.
As for the API. Since I originally wrote the widget just for myself, I didn't see any need... So if you want to... do your thing....
have a nice day
Re: How to draw a rectangle with only two rounded corners?
Hi Andreas,
welcome to the forum.
In my previous post it was not my intention to put your widget "customRect" down.
I see every widget as a welcome addition to the available widgets.
I just wanted to point out some differences to Ralf's "Universal Button" which has the same functionality for the original poster.
And I know that the original poster does commercial apps
In case you felt offended by my comments I would like to ask you to accept my appologies.
Kind regards
Bernd
welcome to the forum.
In my previous post it was not my intention to put your widget "customRect" down.
I see every widget as a welcome addition to the available widgets.
I just wanted to point out some differences to Ralf's "Universal Button" which has the same functionality for the original poster.
And I know that the original poster does commercial apps
In case you felt offended by my comments I would like to ask you to accept my appologies.
Kind regards
Bernd
-
- Posts: 5
- Joined: Fri Nov 19, 2021 1:12 pm
Re: How to draw a rectangle with only two rounded corners?
All fine, bernd
both widgets are just different. Not the same.
CustomRect never wrote for button use. Its just a designelement.
both widgets are just different. Not the same.
CustomRect never wrote for button use. Its just a designelement.
Re: How to draw a rectangle with only two rounded corners?
I've used customRect as a button, no problem - it just needs a short script (which can be added as a behaviour) to give a visual response to mouse click and it works perfectly (pretty much as with any rect).
I only once had a weird visual artefact (a straight line showing around the curve) when 'switching off' some corners.
But this was eliminating by switching on all corners and setting the ones i wanted orthogonal to '1', and i've never since had any graphical oddities with it (admittedly, tested on Mac only).
As for the API (if you want to control in script) the 2 functions it has work just fine:
I wasn't previously aware of it Universal Button - On quick testing this seems to be a button on steroids and a useful addition indeed!
Will definitely make use of it.
But hard to control each corner independently (at least from the properties panel).
The OP was asking how to create a rect with 2 orthogonal corners and 2 rounded corners - it's a breeze with customRect.
But great discussion as I've now also found Universal button, and hopefully others have found customRect.
And thanks to both Andreas and Ralph for providing these great widgets!
I only once had a weird visual artefact (a straight line showing around the curve) when 'switching off' some corners.
But this was eliminating by switching on all corners and setting the ones i wanted orthogonal to '1', and i've never since had any graphical oddities with it (admittedly, tested on Mac only).
As for the API (if you want to control in script) the 2 functions it has work just fine:
Code: Select all
set TopLeftRadius|TopRightRadius|BottomLeftRadius|BottomRightRadius of widget "Custom Rect" to [Number]
set showTopLeft|showTopRight|showBottomLeft|showBottomRight of widget "Custom Rect" to true|false
Will definitely make use of it.
But hard to control each corner independently (at least from the properties panel).
The OP was asking how to create a rect with 2 orthogonal corners and 2 rounded corners - it's a breeze with customRect.
But great discussion as I've now also found Universal button, and hopefully others have found customRect.
And thanks to both Andreas and Ralph for providing these great widgets!
-
- Posts: 5
- Joined: Fri Nov 19, 2021 1:12 pm
Re: How to draw a rectangle with only two rounded corners?
https ://github. com/Hoerwi/LC-Widget-customRect
-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: How to draw a rectangle with only two rounded corners?
This might be a very goofy question indeed, but it won't be my first, so here goes:
If I set up a 'standard' rounded rectange graphic object on a stack, vis:
- -
Is there a way I can get a list of its points like those in a hand-drawn graphic?
- - -
Ah, well; eternally hopeful and eternally naive.
If I set up a 'standard' rounded rectange graphic object on a stack, vis:
- -
Is there a way I can get a list of its points like those in a hand-drawn graphic?
- - -
Ah, well; eternally hopeful and eternally naive.

-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: How to draw a rectangle with only two rounded corners?
Code: Select all
set the editmode of grc "P2" to "polygon"

Re: How to draw a rectangle with only two rounded corners?
You can get the points but don't think you can set them directly - but you can assign these to a polygon graphic.richmond62 wrote: ↑Sat Nov 20, 2021 2:01 pmIs there a way I can get a list of its points like those in a hand-drawn graphic?
to get the points of a rounded rect:
Code: Select all
put the effective points of grc "Round Rectangle"
Code: Select all
set the points of grc "polygon" to the effective points of arc "rounded rectangle"

-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: How to draw a rectangle with only two rounded corners?
Indeed: not everyone is as bloody-minded as I am.it's just so much easier

Re: How to draw a rectangle with only two rounded corners?
Just as an aside, I fondly remember my absolute favorite tool in SuperCard . . . I think it was called the Shrink Tool. With it, you could assemble, for example, a rounded corner rect or button and a squared corner rect or button and then use the Shrink Tool to collapse a single polygon around around the assembled items. It also worked to expand a polygon inside open objects.
I've tried to recreate this tool in LC, but so far, no cigar. Now there's a challenge for the many more talented of you out there!
Roger
I've tried to recreate this tool in LC, but so far, no cigar. Now there's a challenge for the many more talented of you out there!
Roger
Re: How to draw a rectangle with only two rounded corners?
I wasn't able to get this link to work, even after removing the extra spaces. But I downloaded it from stam's link and it works. This is a useful addition and a good companion to the Universal Button widget. I now have both and it's great to have choices. Thank you for sharing this.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10116
- Joined: Fri Feb 19, 2010 10:17 am
Re: How to draw a rectangle with only two rounded corners?
Code: Select all
set the points of grc "polygon" to the effective points of arc "rounded rectangle"
Queer, very queer indeed:
- -
I really wonder what happened there.
I was expecting a full replica of my rounded rectangle . . . but, obviously, I was wrong.

- - -
Err, I dragged P3 back to its original position for display purposes.