mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
metal: contrary to documentation, we need to set the drawableSize explicitly.
Fixes Bugzilla #4149.
This commit is contained in:
@@ -66,9 +66,8 @@
|
|||||||
/* Allow resize. */
|
/* Allow resize. */
|
||||||
self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||||
|
|
||||||
/* Set the desired scale. The default drawableSize of a CAMetalLayer
|
/* Set the desired scale. */
|
||||||
* is its bounds x its scale so nothing further needs to be done.
|
((CAMetalLayer *) self.layer).drawableSize = NSSizeToCGSize([self bounds].size);
|
||||||
*/
|
|
||||||
self.layer.contentsScale = scale;
|
self.layer.contentsScale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,8 +49,8 @@
|
|||||||
{
|
{
|
||||||
if ((self = [super initWithFrame:frame])) {
|
if ((self = [super initWithFrame:frame])) {
|
||||||
self.tag = METALVIEW_TAG;
|
self.tag = METALVIEW_TAG;
|
||||||
/* Set the desired scale. The default drawableSize of a CAMetalLayer
|
/* Set the desired scale. */
|
||||||
* is its bounds x its scale so nothing further needs to be done. */
|
((CAMetalLayer *) self.layer).drawableSize = self.bounds.size;
|
||||||
self.layer.contentsScale = scale;
|
self.layer.contentsScale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user