Closed zhangzheheng12345 closed 1 year ago
Looks like only the documentation is incorrect. The code does return a Two.RoundedRectangle
. You can modify the radius
property like in this Codepen to change the radius.
This commit fixes the documentation. It will take a few days for the docs on the website to reflect these changes. Thanks for posting!
Yeah in the codepen it works well, but in my project, it seems just not work. Neither can I pass the build process (tsup, while generating .d.ts file) or make the code editor with no error marks. My Two.js version is v0.8.10. And if I find a place to upload images, I'll put up my screen shots.
Photos here:
Thanks for sharing. The types for TypeScript are generated from the documentation, so the types are incorrect throwing errors in your project. If you want to remedy the issue immediately, use the github version of the repository instead of npm. You can use it like so:
npm install --save https://github.com/jonobr1/two.js
OK I got it. Thank you for solving my problem. I'll use github version first and really hope this can be solved soon in the next npm version. Issue closed.
Yes, this will be fixed in the next NPM version. Thanks again for posting!
Just want to ask why
Two.makeRoundedRectangle
returnsTwo.Rectangle
but notTwo.RoundedRectangle
? And how to create a rounded rectangle whose radius can be changed?