You can do this with CSS styles:
<Stage width={window.innerWidth} height={window.innerHeight} style={{
backgroundColor: 'grey',
borderRadius: '15px',
overflow: 'hidden'
}}>
The CSS solution is simpler, but if you want to do it with Konva there is a clipping function you can use.
https://konvajs.github.io/docs/clipping/Clipping_Function.html
您可以为Rect对象提供cornerRadius
键属性
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.