mirror of https://github.com/mpv-player/mpv
mac/common: reuse hidpi window scale frame calculation helper
This commit is contained in:
parent
5178c5b7d1
commit
c555cfccfe
|
@ -601,10 +601,8 @@ class Common: NSObject {
|
||||||
case VOCTRL_GET_UNFS_WINDOW_SIZE:
|
case VOCTRL_GET_UNFS_WINDOW_SIZE:
|
||||||
let sizeData = data!.assumingMemoryBound(to: Int32.self)
|
let sizeData = data!.assumingMemoryBound(to: Int32.self)
|
||||||
let size = UnsafeMutableBufferPointer(start: sizeData, count: 2)
|
let size = UnsafeMutableBufferPointer(start: sizeData, count: 2)
|
||||||
var rect = window?.unfsContentFrame ?? NSRect(x: 0, y: 0, width: 1280, height: 720)
|
let rect = (Bool(option.vo.hidpi_window_scale) ? window?.unfsContentFrame
|
||||||
if let screen = window?.currentScreen, !Bool(option.vo.hidpi_window_scale) {
|
: window?.unfsContentFramePixel) ?? NSRect(x: 0, y: 0, width: 1280, height: 720)
|
||||||
rect = screen.convertRectToBacking(rect)
|
|
||||||
}
|
|
||||||
|
|
||||||
size[0] = Int32(rect.size.width)
|
size[0] = Int32(rect.size.width)
|
||||||
size[1] = Int32(rect.size.height)
|
size[1] = Int32(rect.size.height)
|
||||||
|
|
Loading…
Reference in New Issue