NSView -scaleUnitSquareToSize 将视图保留为空白,直到调整大小为止,尽管 -setNeedsDisplay 消息

发布于 2024-09-11 15:22:20 字数 446 浏览 1 评论 0原文

我使用了这个指南: http://developer.apple.com/mac /library/qa/qa2004/qa1346.html 在特殊视图中实现缩放。缩放视图是 NSScrollView 的文档视图。问题是,当我调用 -scaleUnitSquareToSize,然后调用 -setNeedsDisplay:YES (我还在滚动视图上尝试了 -setNeedsDisplay:YES)时,视图(不是滚动条,只是里面的所有内容)变成空白。如果我调整包含视图的窗口的大小,其内容将重新出现并正确显示。但一旦我重新缩放并重新绘制,它就会再次空白。关于如何强制视图正确刷新有什么想法吗?

另外,很抱歉没有提供源代码,但该代码是商业机密,所以......

I used this guide: http://developer.apple.com/mac/library/qa/qa2004/qa1346.html to implement scaling in a special view. The scaled view is the document view of an NSScrollView. The problem is that when I call -scaleUnitSquareToSize, then call -setNeedsDisplay:YES (I also tried -setNeedsDisplay:YES on the scroll view), the view (not the scroll bars, just everything inside) becomes blank. If I resize the window that contains the view, its contents reappear and display properly. But as soon as I rescale and redraw, it blanks out again. Any ideas on how to force the view to refresh properly?

Also, sorry for not providing source code, but the code is trade secret, so...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

满意归宿 2024-09-18 15:22:20

听起来剪辑视图没有更新以处理内容视图的规模。尝试记录文档视图、剪辑视图和内容视图的框架和边界。

sounds like the clipview's not getting updated to deal with the scale of your contentview. Try logging the documentview, clipview, and contentview's frame and bounds.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文