Skip to content

Commit

Permalink
Merge pull request #79 from taublast/2-A
Browse files Browse the repository at this point in the history
2 a
  • Loading branch information
taublast committed Jun 27, 2024
2 parents f4b18b1 + 616cdae commit fe015e6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
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

0 comments on commit fe015e6

Please sign in to comment.