Skip to content

Commit

Permalink
Merge pull request #151 from Gummimundur/fix-canvas-height-resize
Browse files Browse the repository at this point in the history
Fix canvas height resize
  • Loading branch information
taublast authored Jan 10, 2025
2 parents 27dcc26 + 0961072 commit 0467972
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Engine/Views/Canvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected override void InvalidateMeasure()
protected Size AdaptSizeToContentIfNeeded(double widthConstraint, double heightConstraint, bool force = false)
{

if (force || _widthConstraint != widthConstraint && _heightConstraint != heightConstraint)
if (force || _widthConstraint != widthConstraint || _heightConstraint != heightConstraint)
{

var measured = Measure((float)widthConstraint, (float)heightConstraint);
Expand Down Expand Up @@ -120,7 +120,7 @@ protected override Size ArrangeOverride(Rect bounds)

protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
{
if (_lastMeasureConstraints.Width == widthConstraint && _lastMeasureConstraints.Height == heightConstraint)
if (!this.NeedMeasure && _lastMeasureConstraints.Width == widthConstraint && _lastMeasureConstraints.Height == heightConstraint)
{
return _lastMeasureResult;
}
Expand Down Expand Up @@ -581,16 +581,16 @@ public virtual void OnGestureEvent(TouchActionType type, TouchActionEventArgs ar

//this is intended to not lose gestures when fps drops and avoid crashes in double-buffering
PostponeExecutionBeforeDraw(() =>
{
try
{
ProcessGestures(args);
}
catch (Exception e)
{
Trace.WriteLine(e);
}
});
{
try
{
ProcessGestures(args);
}
catch (Exception e)
{
Trace.WriteLine(e);
}
});

Repaint();

Expand Down

0 comments on commit 0467972

Please # to comment.