Make sure we preserve scaling with the GL views

This commit is contained in:
Matthew Leibowitz 2017-06-01 15:32:13 -05:00
Родитель 60832d0e87
Коммит 060ae87389
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -32,9 +32,23 @@ namespace SkiaSharp.Views.Forms
public SKGLViewRendererBase()
{
#if __ANDROID__
touchHandler = new SKTouchHandler(
args => ((ISKGLViewController)Element).OnTouchAction(args),
coord => coord);
#elif __IOS__
touchHandler = new SKTouchHandler(
args => ((ISKGLViewController)Element).OnTouchAction(args),
coord => coord * Control.ContentScaleFactor);
#elif __MACOS__
touchHandler = new SKTouchHandler(
args => ((ISKGLViewController)Element).OnTouchAction(args),
coord => coord * Control.Window.BackingScaleFactor);
#elif WINDOWS_UWP
touchHandler = new SKTouchHandler(
args => ((ISKGLViewController)Element).OnTouchAction(args),
coord => (float)(coord * Control.ContentsScale));
#endif
}
protected override void OnElementChanged(ElementChangedEventArgs<TFormsView> e)