Skip to content

Commit

Permalink
Fix GraphicsView scaling issue (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
myroot authored and rookiejava committed Apr 8, 2022
1 parent dddfb51 commit efc7ab8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ public partial class GraphicsViewHandler : ViewHandler<IGraphicsView, SkiaGraphi
{
protected override SkiaGraphicsView CreateNativeView()
{
return new SkiaGraphicsView(NativeParent);
return new SkiaGraphicsView(NativeParent)
{
DeviceScalingFactor = (float)Tizen.UIExtensions.Common.DeviceInfo.ScalingFactor
};
}

public static void MapDrawable(GraphicsViewHandler handler, IGraphicsView graphicsView)
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Platform/Tizen/MauiShapeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MauiShapeView : SkiaGraphicsView
{
public MauiShapeView(EvasObject parent) : base(parent)
{

DeviceScalingFactor = (float)Tizen.UIExtensions.Common.DeviceInfo.ScalingFactor;
}
}
}
5 changes: 4 additions & 1 deletion src/Core/src/Platform/Tizen/WrapperView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public WrapperView(EvasObject parent) : base(parent)
{
_backgroundCanvas = new Lazy<SkiaGraphicsView>(() =>
{
var view = new SkiaGraphicsView(parent);
var view = new SkiaGraphicsView(parent)
{
DeviceScalingFactor = (float)DeviceInfo.ScalingFactor
};
view.Show();
Children.Add(view);
view.Lower();
Expand Down

0 comments on commit efc7ab8

Please sign in to comment.