【问题标题】:How to create CGRect from CGMutablePath如何从 CGMutablePath 创建 CGRect
【发布时间】:2019-01-19 00:03:43
【问题描述】:

为了使用CGRect 交集函数,我需要从CGMutablePath 创建第二个CGRect。有可能吗?

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

【问题讨论】:

    标签: macos cgrect cgpath


    【解决方案1】:

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

    let rect1 = myPath.boundingBoxOfPath
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-17
      • 2018-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多