Browse Source
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
pull/20514/merge
Julien Lebosquain
20 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
3 deletions
-
native/Avalonia.Native/src/OSX/AvnView.mm
-
src/Avalonia.Native/TopLevelImpl.cs
|
|
|
@ -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 => |
|
|
|
{ |
|
|
|
|