This commit is contained in:
Lluis Sanchez 2013-03-27 13:11:09 +01:00
Родитель 0a9ce6f511
Коммит dae886df2f
2 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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));
});