From 24348ba6ad1fdc558c670fb1464149f3008ec59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Mon, 19 Oct 2026 16:34:19 +0300 Subject: [PATCH] only update pixel size during rendering --- components/render/mac/view/RenderGLView.swift | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/components/render/mac/view/RenderGLView.swift b/components/render/mac/view/RenderGLView.swift index c4beeeb..323b041 100644 --- a/components/render/mac/view/RenderGLView.swift +++ b/components/render/mac/view/RenderGLView.swift @@ -33,7 +33,6 @@ final class RenderGLView: NSOpenGLView { var swapInterval: Int32 = 1 context.setValues(&swapInterval, for: .swapInterval) - updatePixelSize() sr_init(pixelWidth, pixelHeight, RENDER_SHADER_MAIN_VS, RENDER_SHADER_MAIN_FS, RENDER_SHADER_SHADOW_VS, RENDER_SHADER_SHADOW_FS, @@ -89,17 +88,15 @@ final class RenderGLView: NSOpenGLView { needsDisplay = true } - private func updatePixelSize() { - let backing = convertToBacking(bounds) - pixelWidth = Int32(max(1, backing.width)) - pixelHeight = Int32(max(1, backing.height)) - } - override func draw(_ dirtyRect: NSRect) { guard ready, let context = openGLContext else { return } context.makeCurrentContext() - updatePixelSize() + + // Update pixel size + let backing = convertToBacking(bounds) + pixelWidth = Int32(max(1, backing.width)) + pixelHeight = Int32(max(1, backing.height)) sr_resize(pixelWidth, pixelHeight)