diff --git a/src/Eto.Mac/Drawing/FormattedTextHandler.cs b/src/Eto.Mac/Drawing/FormattedTextHandler.cs index a85ae693f1..35f5bb4bfd 100644 --- a/src/Eto.Mac/Drawing/FormattedTextHandler.cs +++ b/src/Eto.Mac/Drawing/FormattedTextHandler.cs @@ -48,7 +48,11 @@ protected void ShowGlyphs(IntPtr glyphs, IntPtr positions, nuint glyphCount, Int // what to do with the attributes?? needed? var m = CTFontGetMatrix(font); +#if !VSMAC && (MONOMAC || XAMMAC) m.Translate(textMatrix.x0, textMatrix.y0); +#else + m.Translate(textMatrix.Tx, textMatrix.Ty); +#endif m.Scale(1, -1); ctx.TextMatrix = m; CTFontDrawGlyphs(font, glyphs, positions, glyphCount, ctx.Handle); diff --git a/src/Eto.Mac/Drawing/MatrixHandler.cs b/src/Eto.Mac/Drawing/MatrixHandler.cs index 473b4b5117..3e2b425f29 100644 --- a/src/Eto.Mac/Drawing/MatrixHandler.cs +++ b/src/Eto.Mac/Drawing/MatrixHandler.cs @@ -40,33 +40,38 @@ public void Create (float xx, float yx, float xy, float yy, float dx, float dy) { control = new CGAffineTransform (xx, yx, xy, yy, dx, dy); } - - public float[] Elements - { - get - { - return new float[] { + +#if !VSMAC && (MONOMAC || XAMMAC) + public float[] Elements => new float[] { (float)control.xx, (float)control.yx, (float)control.xy, (float)control.yy, (float)control.x0, - (float)control.y0 - }; - } - } + (float)control.y0 }; public float X0 { get { return (float)control.x0; } set { control.x0 = value; } } - public float Y0 { get { return (float)control.y0; } set { control.y0 = value; } } - public float Xx { get { return (float)control.xx; } set { control.xx = value; } } - public float Xy { get { return (float)control.xy; } set { control.xy = value; } } - public float Yx { get { return (float)control.yx; } set { control.yx = value; } } - public float Yy { get { return (float)control.yy; } set { control.yy = value; } } +#else + public float[] Elements => new float[] { + (float)control.A, + (float)control.B, + (float)control.C, + (float)control.D, + (float)control.Tx, + (float)control.Ty }; + + public float X0 { get { return (float)control.Tx; } set { control.Tx = value; } } + public float Y0 { get { return (float)control.Ty; } set { control.Ty = value; } } + public float Xx { get { return (float)control.A; } set { control.A = value; } } + public float Xy { get { return (float)control.C; } set { control.C = value; } } + public float Yx { get { return (float)control.B; } set { control.B = value; } } + public float Yy { get { return (float)control.D; } set { control.D = value; } } +#endif public void Rotate (float angle) { diff --git a/src/Eto.Mac/Drawing/TextureBrushHandler.cs b/src/Eto.Mac/Drawing/TextureBrushHandler.cs index 57589fd142..a72a8f84db 100644 --- a/src/Eto.Mac/Drawing/TextureBrushHandler.cs +++ b/src/Eto.Mac/Drawing/TextureBrushHandler.cs @@ -53,7 +53,7 @@ public void Draw(GraphicsHandler graphics, bool stroke, FillMode fillMode, bool context.SaveState(); context.ConcatCTM(transform); - context.ConcatCTM(new CGAffineTransform(1, 0, 0, -1, 0, Image.Height)); + context.ConcatCTM(new CGAffineTransform(1, 0, 0, -1, 0, (nfloat)Image.Height)); //transform.ToEto().TransformRectangle(rect); if (Opacity < 1f) diff --git a/src/Eto.Mac/Eto.XamMac2.csproj b/src/Eto.Mac/Eto.XamMac2.csproj index 80b19a5c34..6fc2e8deff 100644 --- a/src/Eto.Mac/Eto.XamMac2.csproj +++ b/src/Eto.Mac/Eto.XamMac2.csproj @@ -2,8 +2,8 @@ True - net462;xamarinmac20 - net6.0-macos10.15;$(TargetFrameworks) + net462;xamarinmac20 + net6.0-macos10.15;$(TargetFrameworks) Eto.Mac $(DefineConstants);OSX;DESKTOP;XAMMAC;XAMMAC2;UNIFIED $(DefineConstants);USE_CFSTRING diff --git a/src/Eto.Mac/Forms/Controls/GridViewHandler.cs b/src/Eto.Mac/Forms/Controls/GridViewHandler.cs index cd42092305..f8f65ece58 100644 --- a/src/Eto.Mac/Forms/Controls/GridViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/GridViewHandler.cs @@ -6,7 +6,7 @@ using System.Linq; using Eto.Mac.Forms.Cells; -#if MACOS_NET +#if MACOS_NET && !VSMAC using NSDraggingInfo = AppKit.INSDraggingInfo; #endif @@ -110,8 +110,8 @@ public override bool ValidateProposedFirstResponder(NSResponder responder, NSEve return Handler?.ValidateProposedFirstResponder(responder, forEvent, valid) ?? valid; } -#if XAMMAC2 - public override NSImage DragImageForRowsWithIndexestableColumnseventoffset(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) +#if MACOS_NET + public override NSImage DragImageForRows(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) { var dragInfo = Handler?.DragInfo; var img = dragInfo?.DragImage; @@ -120,10 +120,10 @@ public override NSImage DragImageForRowsWithIndexestableColumnseventoffset(NSInd dragImageOffset = dragInfo.GetDragImageOffset(); return img; } - return base.DragImageForRowsWithIndexestableColumnseventoffset(dragRows, tableColumns, dragEvent, ref dragImageOffset); + return base.DragImageForRows(dragRows, tableColumns, dragEvent, ref dragImageOffset); } -#elif MACOS_NET - public override NSImage DragImageForRows(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) +#elif XAMMAC2 + public override NSImage DragImageForRowsWithIndexestableColumnseventoffset(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) { var dragInfo = Handler?.DragInfo; var img = dragInfo?.DragImage; @@ -132,7 +132,7 @@ public override NSImage DragImageForRows(NSIndexSet dragRows, NSTableColumn[] ta dragImageOffset = dragInfo.GetDragImageOffset(); return img; } - return base.DragImageForRows(dragRows, tableColumns, dragEvent, ref dragImageOffset); + return base.DragImageForRowsWithIndexestableColumnseventoffset(dragRows, tableColumns, dragEvent, ref dragImageOffset); } #else diff --git a/src/Eto.Mac/Forms/Controls/SliderHandler.cs b/src/Eto.Mac/Forms/Controls/SliderHandler.cs index 6a21e19a9d..b1e4fc9915 100644 --- a/src/Eto.Mac/Forms/Controls/SliderHandler.cs +++ b/src/Eto.Mac/Forms/Controls/SliderHandler.cs @@ -26,7 +26,7 @@ public SliderHandler Handler set { WeakHandler = new WeakReference(value); } } -#if MACOS_NET +#if MACOS_NET && !VSMAC public override bool IsVertical => Handler?.Orientation == Orientation.Vertical; #else public override nint IsVertical => Handler?.Orientation == Orientation.Vertical ? 1 : 0; diff --git a/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs b/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs index 59a1788d20..4ebda284f2 100644 --- a/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs @@ -66,7 +66,7 @@ public object Handler set { WeakHandler = new WeakReference(value); } } -#if MACOS_NET +#if MACOS_NET && !VSMAC public override void ChangeColor(NSColorPanel sender) { // ignore color changes diff --git a/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs b/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs index 9035054be1..13ec803c91 100644 --- a/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs @@ -5,7 +5,7 @@ using Eto.Mac.Forms.Cells; using Eto.Drawing; -#if MACOS_NET +#if MACOS_NET && !VSMAC using NSDraggingInfo = AppKit.INSDraggingInfo; #endif diff --git a/src/Eto.Mac/Forms/MacWindow.cs b/src/Eto.Mac/Forms/MacWindow.cs index 5db0e808fe..1f39e004a2 100644 --- a/src/Eto.Mac/Forms/MacWindow.cs +++ b/src/Eto.Mac/Forms/MacWindow.cs @@ -421,7 +421,7 @@ public override void AttachEvent(string id) if (handler != null) { var args = new NSWindowBackingPropertiesEventArgs(e.Notification); - if (args.OldScaleFactor != handler.Control.BackingScaleFactor) + if ((nfloat)args.OldScaleFactor != handler.Control.BackingScaleFactor) handler.Callback.OnLogicalPixelSizeChanged(handler.Widget, EventArgs.Empty); } });