diff --git a/GSS2.UI.Core/Views/CameraView.axaml.cs b/GSS2.UI.Core/Views/CameraView.axaml.cs index 606e423..71c7264 100644 --- a/GSS2.UI.Core/Views/CameraView.axaml.cs +++ b/GSS2.UI.Core/Views/CameraView.axaml.cs @@ -15,6 +15,7 @@ using Avalonia.Input; using GSS2.UI.Core.ViewModels; using Avalonia.Markup.Xaml; using GSS2.Core.UI.Extensions; +using Avalonia.VisualTree; namespace GSS2.UI.Core.Views; @@ -427,7 +428,19 @@ public partial class CameraView : OpenGlControlBase context.FillRectangle(new SolidColorBrush(Background), new Rect(0, 0, Bounds.Width, Bounds.Height)); base.Render(context); } - private void RenderRequested(object? sender, EventArgs ea) => Dispatcher.UIThread.Invoke(() => RequestNextFrameRendering()); + private void RenderRequested(object? sender, EventArgs ea) + { + Dispatcher.UIThread.Invoke(() => + { + var transformBounds = this.GetTransformedBounds(); + if (transformBounds is not null && + (transformBounds.Value.Clip.Bottom != 0 || + transformBounds.Value.Clip.Top != 0 || + transformBounds.Value.Clip.Left != 0 || + transformBounds.Value.Clip.Right != 0)) + RequestNextFrameRendering(); + }); + } protected override void OnOpenGlInit(GlInterface gl) {