changeset 2421:d88928a85436

iOS: Fix DWMLE, have to created it like this to have valid textStorage.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 03 Apr 2021 21:25:25 +0000
parents 384d076ed52a
children 4a353a83b2e4
files ios/dw.m
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ios/dw.m	Sat Apr 03 19:14:29 2021 +0000
+++ b/ios/dw.m	Sat Apr 03 21:25:25 2021 +0000
@@ -4423,6 +4423,10 @@
 {
     CGRect frame = CGRectMake(0, 0, 100, 50);
     NSTextContainer *tc = [[NSTextContainer alloc] initWithSize:frame.size];
+    NSLayoutManager *lm = [[NSLayoutManager alloc] init];
+    NSTextStorage *ts = [[NSTextStorage alloc] init];
+    [lm addTextContainer:tc];
+    [ts addLayoutManager:lm];
     DWMLE *mle = [[[DWMLE alloc] initWithFrame:frame textContainer:tc] retain];
     CGSize size = [mle intrinsicContentSize];