macOS: Ensure render target is at least 1x1 (#20610)

* Ensure Metal render target is at least 1x1

* Ensure software render target is at least 1x1
This commit is contained in:
Julien Lebosquain
2026-02-05 11:51:42 +00:00
committed by GitHub
parent 9f02346cd6
commit 5f47b4be53
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -42,7 +42,8 @@
- (void) updateRenderTarget
{
if(_currentRenderTarget) {
[_currentRenderTarget resize:_lastPixelSize withScale:static_cast<float>([[self window] backingScaleFactor])];
AvnPixelSize size { MAX(_lastPixelSize.Width, 1), MAX(_lastPixelSize.Height, 1) };
[_currentRenderTarget resize:size withScale:static_cast<float>([[self window] backingScaleFactor])];
[self setNeedsDisplayInRect:[self frame]];
}
}
+2 -2
View File
@@ -566,8 +566,8 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{
ObjectDisposedException.ThrowIf(_target is null, this);
var w = _parent._savedLogicalSize.Width * _parent._savedScaling;
var h = _parent._savedLogicalSize.Height * _parent._savedScaling;
var w = Math.Max(_parent._savedLogicalSize.Width * _parent._savedScaling, 1);
var h = Math.Max(_parent._savedLogicalSize.Height * _parent._savedScaling, 1);
var dpi = _parent._savedScaling * 96;
return new DeferredFramebuffer(_target, cb =>
{