简体   繁体   中英

How to create CGRect from CGMutablePath

In order to use the CGRect intersection function I need to create a second CGRect from CGMutablePath . Is it possible?

let rect1 = CGRect(myPath) // not allowed
let intersectionRect = rect2.intersection(rect1)

目前尚不清楚您希望从路径中获得哪个矩形,但是您是否想要boundingBoxOfPath呢?

let rect1 = myPath.boundingBoxOfPath

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