@@ -18,11 +18,7 @@ public partial class MapControl : UIView, IMapControl
1818 {
1919 private readonly SKGLView _canvas = new SKGLView ( ) ;
2020 private double _innerRotation ;
21- /// <summary>
22- /// The number of pixels per device independent unit
23- /// </summary>
24- private float _pixelDensity ;
25-
21+
2622 public MapControl ( CGRect frame )
2723 : base ( frame )
2824 {
@@ -52,9 +48,6 @@ public void Initialize()
5248 NSLayoutConstraint . Create ( this , NSLayoutAttribute . Bottom , NSLayoutRelation . Equal , _canvas , NSLayoutAttribute . Bottom , 1.0f , 0.0f )
5349 } ) ;
5450
55- // Unfortunately the SKGLView does not have a IgnorePixelScaling property. We have to adjust for density with SKGLView.Scale.
56- _pixelDensity = PixelDensity ;
57-
5851 TryInitializeViewport ( ScreenWidth , ScreenHeight ) ;
5952
6053 ClipsToBounds = true ;
@@ -102,8 +95,11 @@ void OnPaintSurface(object sender, SKPaintGLSurfaceEventArgs args)
10295 TryInitializeViewport ( ScreenWidth , ScreenHeight ) ;
10396 if ( ! _map . Viewport . Initialized ) return ;
10497
105- args . Surface . Canvas . Scale ( _pixelDensity , _pixelDensity ) ; // we can only set the scale in the render loop
98+ // Unfortunately the SKGLView does not have a IgnorePixelScaling property,
99+ // so have to adjust for density with SKGLView.Scale.
100+ // The Scale can only be set in the render loop
106101
102+ args . Surface . Canvas . Scale ( PixelDensity , PixelDensity ) ;
107103 Renderer . Render ( args . Surface . Canvas , _map . Viewport , _map . Layers , _map . Widgets , _map . BackColor ) ;
108104 }
109105
0 commit comments