Presto rectangle with curved corners

Per the docs:

rectangle(x, y, w, h, corners=(r1, r2, r3, r4), stroke=0)

But when I try this:

display.rectangle(30, 0, 420, 420, ((20, 20, 20, 10)), 1)

I get this error:
function takes 5 positional arguments but 7 were given

When I try this:

display.rectangle(30, 0, 420, 420, corners=((20, 20, 20, 10)), stroke=1)

I get this error:
function doesn’t take keyword arguments

What am I doing wrong?

Ah, I see. I’ve confused picographics and picovector. Same function names, different attributes. Working now.

What happens if you try?
display.rectangle(30, 0, 420, 420, (20, 20, 20, 10), 1)

I don’t own a Presto, just so you know.

Did you? I’ve just had the same when using the PicoVector graphics on my Presto, and the docs for the PicoVector clearly state “rectangle(x, y, w, h, corners=(r1, r2, r3, r4), stroke=0)".

I’m just getting going with the Presto and the picovector graphics which I’ve not used before. I’ve managed to construct a nice compass widget, got some buttons and touch working, and I then attempted to create some nice rounded corner buttons. But then hit the problem that was outlined in the op.

The doc’s on the presto regarding the picovector are somewhat sparse, and seemingly inaccurate which is a bit frustrating. A search of the Pimoroni repositories for picographics did not find a match.

Its not clear if @retired_guy actually did find a way to do rounded corners, and for tonight I’ve boggle eyed myself quite enough looking for any rounded rectangle examples in the Presto example programs. Anyone got rounded rectangles on the Presto? Maybe the way is to draw a polygon shape :(

I haven’t looked at it in a good while, but I think so. See lines 135-140 in main.py here:

Thanks @retired_guy , I see the way it works now. There were clues in the short doc on picovector but I got fixated with the display.rectangle that was ok for the square corners. Doh! Well now my buttons look much prettier. :)