简体   繁体   English

如何在带有w / dojo的矢量矩形上制作圆角?

[英]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. 从文档中绝对不明显,但是我找到了向构造函数添加“ r”参数的参考。 The following works for me. 以下对我有用。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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