我的项目在Mac 10.10/10.9上工作得很好,但是在10.11中,它在下面的代码中不正确地工作:
[(PDFAnnotationInk*)_activeAnnotation removeBezierPath:_path];
[_activeAnnotation setBounds:bound];
// Lazy, redraw entire view.
NSAffineTransform* transform = [NSAffineTransform transform];
[transform translateXBy:-bound.origin.x yBy:-bound.origin.y];
[_path transformUsingAffineTransform:transform];
[(PDFAnnotationInk*)_activeAnnotation addBezierPath:_path];
[[_activeAnnotation page] removeAnnotation: _activeAnnotation];
[self addAnnotationSelector:_activeAnnotation];当我更改这个转换时,translateXBy::-界.原. this:-界.原.y;
至
变换(TranslateXBy):界.原.:界.原.y;
应用程序在OSX 10.11上正确工作,但在OSX 10.10/10.9上不正确。
我不知道为什么,NSAffineTransform在最新的MacOSX10.11中有不同的坐标系统吗?如何解决这个问题以使应用程序与10.10/9和10.11兼容?谢谢。
发布于 2015-11-14 13:13:04
我也有同样的问题。关于如何定位注释的规则没有文档化;没有任何地方说墨迹路径必须相对于注释的起源,但是它们是相对的。我想苹果公司的某个人可能是不小心把它弄坏了,或者是改变了他们的想法。
在他们再次改变主意(或修复错误)之前,我正在检查系统版本(在/System/Library/CoreServices/SystemVersion.plist)中使用ProductVersion键,并使用10.10及更早版本的旧方式,以及10.11及更高版本的非颠倒起源的新方法。
https://stackoverflow.com/questions/33316625
复制相似问题