[Mac] Fix image rendering
This commit is contained in:
Родитель
0a9ce6f511
Коммит
dae886df2f
|
@ -250,8 +250,10 @@ namespace Xwt.Mac
|
|||
((CustomImage)pi.Image).DrawInContext (c);
|
||||
});
|
||||
} else {
|
||||
pattern = new CGPattern (bounds, t, bounds.Width, bounds.Height,
|
||||
CGPatternTiling.ConstantSpacing, true, c => c.DrawImage (bounds, null));
|
||||
RectangleF empty = RectangleF.Empty;
|
||||
CGImage cgimg = ((NSImage)pi.Image).AsCGImage (ref empty, null, null);
|
||||
pattern = new CGPattern (bounds, CGAffineTransform.MakeScale (1f, -1f), bounds.Width, bounds.Height,
|
||||
CGPatternTiling.ConstantSpacing, true, c => c.DrawImage (bounds, cgimg));
|
||||
}
|
||||
|
||||
CGContext ctx = gc.Context;
|
||||
|
|
|
@ -130,8 +130,8 @@ namespace Xwt.Mac
|
|||
|
||||
var ctx = new CGContextBackend {
|
||||
Context = bmp,
|
||||
Size = new SizeF (pixelWidth, pixelHeight)/*,
|
||||
InverseViewTransform = bmp.GetCTM ().Invert ()*/
|
||||
Size = new SizeF (pixelWidth, pixelHeight),
|
||||
InverseViewTransform = bmp.GetCTM ().Invert ()
|
||||
};
|
||||
|
||||
var ci = (CustomImage)handle;
|
||||
|
@ -271,7 +271,7 @@ namespace Xwt.Mac
|
|||
|
||||
internal void DrawInContext (CGContextBackend ctx)
|
||||
{
|
||||
var s = Size;
|
||||
var s = ctx.Size != SizeF.Empty ? ctx.Size : Size;
|
||||
actx.InvokeUserCode (delegate {
|
||||
drawCallback (ctx, new Rectangle (0, 0, s.Width, s.Height));
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче