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

bring PR fixes to DEV #152

Merged
merged 9 commits into from
Jan 10, 2025
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
Loading