NSLayoutManager setAllowsNonContigouslyLayout 放错插入符位置
将 setAllowsNonContigouslyLayout 设置为 YES 时,如果执行以下步骤,我会得到奇怪的行为:
- 选择 NSTextView 中的所有文本
- 按退格键删除所有文本
- 输入几行文本
- 尝试使用退格键删除文本再次
在步骤 4 中,光标跳到上面的行以及该行上看似随机的点,但实际的字形已从正确的位置删除。
像这样的非连续布局是否有点实验性/有缺陷?如果我把它关掉,事情就会按预期进行。
我将向 Apple 提交错误报告,但有其他人看到此行为并解决它吗?
With setAllowsNonContiguousLayout
set to YES, if I perform the following steps I get weird behaviour:
- Select all text in the NSTextView
- Hit backspace to remove all the text
- Type a few lines of text
- Trying using backspace to delete the text again
At step 4 the cursor jumps up to the line above and at a seemingly random point on the line, yet the actual glyphs are deleted from the correct location.
Is non-contiguous layout a bit experimental/buggy like this? If I turn it off things work as expected.
I'll file a bug report with Apple, but has anybody else seen this behaviour and worked around it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为错误报告是正确的方法。据我所知,非连续布局给一些开发人员带来了很多麻烦,使他们再次从应用程序中删除该功能。尽管听起来不错,但要正常工作似乎是一件地狱般的事情……即使对苹果来说也是如此。
A bug report is the right way to go, I think. From what I've heard is that non-contignuous layout has caused lots of headaches to some developers making them drop that feature again from their application. As nice as it sounds, it seemingly is hell of a thing to get to work right ... even for Apple.