Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 a #79

Merged
merged 3 commits into from
Jun 27, 2024
Merged

2 a #79

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2</Version>
<Version>1.2.3.3</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(UseSkiaSharp3)' == 'true'">
Expand Down
9 changes: 8 additions & 1 deletion src/Engine/Draw/Layout/SkiaLayout.ColumnRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ public virtual ScaledSize MeasureStack(SKRect rectForChildrenPixels, float scale
}

var maybeSecondPass = Type == LayoutType.Row &&
(float.IsInfinity(rectForChild.Bottom) || float.IsInfinity(rectForChild.Top));
(float.IsInfinity(rectForChild.Bottom) || float.IsInfinity(rectForChild.Top))
|| Type == LayoutType.Column &&
(float.IsInfinity(rectForChild.Right) || float.IsInfinity(rectForChild.Left));

List<SecondPassArrange> listSecondPass = new();

//measure
Expand Down Expand Up @@ -391,6 +394,10 @@ public virtual ScaledSize MeasureStack(SKRect rectForChildrenPixels, float scale
else
{
measured = MeasureAndArrangeCell(rectFitChild, cell, child, scale);
if (child.Tag == "First")
{
var stop = 1;
}
if (maybeSecondPass) //has infinity in destination
{
if (Type == LayoutType.Column && child.HorizontalOptions != LayoutOptions.Start)
Expand Down
16 changes: 8 additions & 8 deletions src/Engine/Draw/SkiaControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5015,7 +5015,6 @@ protected virtual bool UseRenderingObject(SkiaDrawingContext context, SKRect rec
RenderObjectPreviousNeedsUpdate = false;
if (kill != null)
{

Tasks.StartDelayed(TimeSpan.FromSeconds(3.5), () =>
{
kill.Dispose();
Expand Down Expand Up @@ -5531,13 +5530,8 @@ void draw(SkiaDrawingContext context)

if (RenderObject != null && UsingCacheType != SkiaCacheType.ImageDoubleBuffered)
{
//RenderObject = null;
throw new Exception("RenderObject already exists for CreateRenderingObjectAndPaint! Need to dispose and assign null to it before.");
}

if (IsCacheImage && !WillClipBounds)
{
throw new Exception("WillClipBounds is required to be TRUE for caching as image.");
//we might come here with an existing RenderingObject if UseRenderingObject returned False
RenderObject = null;
}

RenderObjectNeedsUpdate = false;
Expand All @@ -5556,6 +5550,12 @@ void draw(SkiaDrawingContext context)
}

var created = CreateRenderingObject(context, recordingArea, oldObject, action);

if (created == null)
{
return;
}

if (oldObject != null)
{
if (created.SurfaceIsRecycled)
Expand Down
Loading