简体   繁体   中英

How do you make rounded corners on a vector rectangle w/dojo?

In the vector tutorial it says you can do it, in the reference documentation it says in parenthesis (with optional rounded corners), and googling all I can find is something along the lines of, 'and of course, what tk would be complete without rounded corners...' yet no one seems to bother mentioning how to do it.

I'm guessing it's an optional parameter in the construction, that would make the most sense, but why is this not listed anywhere? I shouldn't have to look at the source code or guess in order to make something so basic work. Thanks guys.

It definitely not obvious from the documentation, but I found a reference to adding an "r" parameter to the constructor. The following works for me.

surface.createRect({ x: 0, y: 0, width: 30, height: 30, r:10 }).setFill("red");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM