Skip to content

Commit

Permalink
Fix lua logging clogging dispatcher queue, implement basic measuring …
Browse files Browse the repository at this point in the history
…logic for WindowedGlControl
  • Loading branch information
Aurumaker72 committed Aug 17, 2023
1 parent 345ea0f commit 46ec11c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions M64RPFW.Views.Avalonia/Controls/OpenGL/WindowedGlControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ public unsafe class WindowedGlControl : NativeControlHost, IOpenGLContextService
private GL _skGl = null!;
private GRContext _grContext = null!;
private SKSurface? _skSurface;


protected override Size MeasureOverride(Size availableSize)
{
return _realSize.ToSize(1);
}

public event EventHandler<SkiaRenderEventArgs>? SkiaRender;

Expand Down Expand Up @@ -158,7 +162,7 @@ protected override void OnSizeChanged(SizeChangedEventArgs e)

lock (_sizeLock)
_realSize = new PixelSize((int) (baseSize.Width * scaling), (int) (baseSize.Height * scaling));

_sizeDirty = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion M64RPFW.Views.Avalonia/Views/LuaWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void Print(string value)
Dispatcher.UIThread.Post(() => {
LogTextBox.Text += $"{value}\r\n";
LogScrollViewer.ScrollToEnd();
});
}, DispatcherPriority.Background);
}

private void OnClearClicked(object? sender, RoutedEventArgs e)
Expand Down

0 comments on commit 46ec11c

Please sign in to comment.