diff options
author | Sandy Armstrong <sandy@xamarin.com> | 2022-02-11 22:11:03 +0300 |
---|---|---|
committer | Sandy Armstrong <sandy@xamarin.com> | 2022-02-16 23:14:06 +0300 |
commit | 895fc1f76bd4bab49614c82e8ad0037a2703b698 (patch) | |
tree | 86875e50eacb5ce851db202ecbc9c208ae528666 | |
parent | 18b2431d79941d7af1fd4bae24a1b4e5a56a9084 (diff) |
API breaks for P13
-rw-r--r-- | Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs | 2 | ||||
-rw-r--r-- | Xwt.XamMac/Xwt.Mac/PopoverBackend.cs | 2 | ||||
-rw-r--r-- | Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs | 2 | ||||
-rw-r--r-- | Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs | 21 | ||||
-rw-r--r-- | Xwt.XamMac/Xwt.Mac/Util.cs | 2 |
5 files changed, 14 insertions, 15 deletions
diff --git a/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs index 9627b32f..b0533309 100644 --- a/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs +++ b/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs @@ -361,7 +361,7 @@ namespace Xwt.Mac public override Matrix GetCTM (object backend) { CGAffineTransform t = GetContextTransform ((CGContextBackend)backend); - Matrix ctm = new Matrix (t.xx, t.yx, t.xy, t.yy, t.x0, t.y0); + Matrix ctm = new Matrix (t.A, t.B, t.C, t.D, t.Tx, t.Ty); return ctm; } diff --git a/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs b/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs index 3379dc38..c0c1c7ef 100644 --- a/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs @@ -259,7 +259,7 @@ namespace Xwt.Mac controller.EffectiveAppearanceName = refView.EffectiveAppearance.Name; if (popover is INSAppearanceCustomization) - ((INSAppearanceCustomization)popover).SetAppearance (refView.EffectiveAppearance); + ((INSAppearanceCustomization)popover).Appearance = refView.EffectiveAppearance; } popover.Show (positionRect.ToCGRect (), diff --git a/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs b/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs index e539eb7f..d5495168 100644 --- a/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs @@ -326,7 +326,7 @@ namespace Xwt.Mac TextStorage.EnumerateAttributes (new NSRange (0, TextStorage.Length), NSAttributedStringEnumeration.None, (NSDictionary attrs, NSRange range, ref bool stop) => { stop = false; if (attrs.ContainsKey (NSStringAttributeKey.Link)) { - var rects = RectsForCharacterRange (range); + var rects = GetRects (range); for (nuint i = 0; i < rects.Count; i++) AddCursorRect (rects.GetItem<NSValue> (i).CGRectValue, NSCursor.PointingHandCursor); } diff --git a/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs index 39700067..5dd7d738 100644 --- a/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs +++ b/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs @@ -147,7 +147,7 @@ namespace Xwt.Mac // paragraph style TextContainer.LineBreakMode = TextTrimming == TextTrimming.WordElipsis ? NSLineBreakMode.TruncatingTail : NSLineBreakMode.ByWordWrapping; - var pstyle = NSParagraphStyle.DefaultParagraphStyle.MutableCopy () as NSMutableParagraphStyle; + var pstyle = NSParagraphStyle.Default.MutableCopy () as NSMutableParagraphStyle; pstyle.Alignment = TextAlignment.ToNSTextAlignment (); if (TextTrimming == TextTrimming.WordElipsis) pstyle.LineBreakMode = NSLineBreakMode.TruncatingTail; @@ -260,8 +260,8 @@ namespace Xwt.Mac TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.DrawBackgroundForGlyphRange (new NSRange(0, Text.Length), new CGPoint (x, y)); - TextLayout.DrawGlyphsForGlyphRange (new NSRange(0, Text.Length), new CGPoint (x, y)); + TextLayout.DrawBackground (new NSRange(0, Text.Length), new CGPoint (x, y)); + TextLayout.DrawBackground (new NSRange(0, Text.Length), new CGPoint (x, y)); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); } @@ -280,8 +280,8 @@ namespace Xwt.Mac { TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.GlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); - var s = TextLayout.GetUsedRectForTextContainer (TextContainer); + TextLayout.GetGlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); + var s = TextLayout.GetUsedRect (TextContainer); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); return s.Size; @@ -304,9 +304,8 @@ namespace Xwt.Mac { TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.GlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); - nfloat fraction = 0; - var index = TextLayout.CharacterIndexForPoint (new CGPoint (x, y), TextContainer, ref fraction); + TextLayout.GetGlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); + var index = TextLayout.GetCharacterIndex (new CGPoint (x, y), TextContainer, out var fraction); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); return index; @@ -319,9 +318,9 @@ namespace Xwt.Mac { TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.GlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); - var glyphIndex = TextLayout.GlyphIndexForCharacterAtIndex (index); - var p = TextLayout.LocationForGlyphAtIndex ((nint)glyphIndex); + TextLayout.GetGlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); + var glyphIndex = TextLayout.GetGlyphIndex ((nuint)index); + var p = TextLayout.GetLocationForGlyph ((nuint)glyphIndex); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); return p; diff --git a/Xwt.XamMac/Xwt.Mac/Util.cs b/Xwt.XamMac/Xwt.Mac/Util.cs index 9d7799cb..3f6f75dd 100644 --- a/Xwt.XamMac/Xwt.Mac/Util.cs +++ b/Xwt.XamMac/Xwt.Mac/Util.cs @@ -438,7 +438,7 @@ namespace Xwt.Mac ns.BeginEditing (); var r = new NSRange (0, ns.Length); ns.RemoveAttribute (NSStringAttributeKey.ParagraphStyle, r); - var pstyle = NSParagraphStyle.DefaultParagraphStyle.MutableCopy () as NSMutableParagraphStyle; + var pstyle = NSParagraphStyle.Default.MutableCopy () as NSMutableParagraphStyle; pstyle.Alignment = alignment; ns.AddAttribute (NSStringAttributeKey.ParagraphStyle, pstyle, r); ns.EndEditing (); |