【发布时间】:2016-09-06 15:46:58
【问题描述】:
我必须使用什么方法来计算 CGPoint 从旧位置到新位置的距离?
var point: CGPoint = CGPointMake(x:50.0, y:50.0)
还有一种用LMB拖动点的方法:
func mouseDragged(event: NSEvent) {
var pointDragged = self.convertPoint(event.locationInWindow, fromView: nil)
}
【问题讨论】:
-
需要找X偏移吗?
标签: macos swift2 mouseevent cgpoint