Skip to content

Commit

Permalink
canvas auto-size fix and some more
Browse files Browse the repository at this point in the history
  • Loading branch information
taublast committed Aug 21, 2024
1 parent fc297a3 commit d7befdc
Show file tree
Hide file tree
Showing 10 changed files with 1,670 additions and 1,631 deletions.
40 changes: 20 additions & 20 deletions src/Addons/DrawnUi.Maui.Camera/SkiaCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1506,17 +1506,17 @@ public double ZoomLimitMax
set { SetValue(ZoomLimitMaxProperty, value); }
}

public static readonly BindableProperty BlackColorProperty = BindableProperty.Create(
nameof(BlackColor),
typeof(Color),
typeof(SkiaCamera),
Colors.Black);
//public static readonly BindableProperty BlackColorProperty = BindableProperty.Create(
// nameof(BlackColor),
// typeof(Color),
// typeof(SkiaCamera),
// Colors.Black);

public Color BlackColor
{
get { return (Color)GetValue(BlackColorProperty); }
set { SetValue(BlackColorProperty, value); }
}
//public Color BlackColor
//{
// get { return (Color)GetValue(BlackColorProperty); }
// set { SetValue(BlackColorProperty, value); }
//}

private static void NeedSetZoom(BindableObject bindable, object oldvalue, object newvalue)
{
Expand All @@ -1536,17 +1536,17 @@ private static void NeedSetZoom(BindableObject bindable, object oldvalue, object
}
}

public static readonly BindableProperty WhiteColorProperty = BindableProperty.Create(
nameof(WhiteColor),
typeof(Color),
typeof(SkiaCamera),
Colors.White);
//public static readonly BindableProperty WhiteColorProperty = BindableProperty.Create(
// nameof(WhiteColor),
// typeof(Color),
// typeof(SkiaCamera),
// Colors.White);

public Color WhiteColor
{
get { return (Color)GetValue(WhiteColorProperty); }
set { SetValue(WhiteColorProperty, value); }
}
//public Color WhiteColor
//{
// get { return (Color)GetValue(WhiteColorProperty); }
// set { SetValue(WhiteColorProperty, value); }
//}

public static readonly BindableProperty DisplayModeProperty = BindableProperty.Create(
nameof(DisplayMode),
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<PropertyGroup Condition="'$(UseSkiaSharp3)' != 'true'">
<PackageReleaseNotes>Using SkiaSharp 2.xx. Checkout the DrawnUi Sandbox project for usage example.</PackageReleaseNotes>
<Version>1.2.3.7</Version>
<Version>1.2.3.8</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(UseSkiaSharp3)' == 'true'">
Expand Down
6 changes: 6 additions & 0 deletions src/Engine/Draw/Layout/SkiaLayout.ViewsAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,12 @@ bool CheckTemplateChanged()
AddedMore = 0;
}

if (dataContexts.Count == 0)
{
TemplatesAvailable();
return;
}

if (_parent.InitializeTemplatesInBackgroundDelay > 0)
{
//postpone initialization to be executed in background
Expand Down
3 changes: 2 additions & 1 deletion src/Engine/Draw/Layout/SkiaLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,8 @@ public override ScaledSize Measure(float widthConstraint, float heightConstraint

if (IsTemplated)
{
if (ChildrenFactory.TemplatesInvalidated && !ChildrenFactory.TemplesInvalidating)
if (ChildrenFactory.TemplatesInvalidated
&& !ChildrenFactory.TemplesInvalidating)
{
ChildrenFactory.TemplesInvalidating = true;
ApplyNewItemsSource = false;
Expand Down
Loading

0 comments on commit d7befdc

Please sign in to comment.