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:
committed by
GitHub
parent
9f02346cd6
commit
5f47b4be53
@@ -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]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user