[orx-panel] Fix creation of 0x0 render target on window minimization

This commit is contained in:
Edwin Jakobs
2021-03-19 16:33:10 +01:00
parent 93b607265c
commit ba4db38441

View File

@@ -361,8 +361,9 @@ class ControlManager : Extension {
this.width = width this.width = width
this.height = height this.height = height
// check if user did not minimize window
if (width > 0 && height > 0) {
body?.draw?.dirty = true body?.draw?.dirty = true
if (renderTarget.colorAttachments.isNotEmpty()) { if (renderTarget.colorAttachments.isNotEmpty()) {
renderTarget.colorBuffer(0).destroy() renderTarget.colorBuffer(0).destroy()
renderTarget.depthBuffer?.destroy() renderTarget.depthBuffer?.destroy()
@@ -385,6 +386,7 @@ class ControlManager : Extension {
renderTargetCache.forEach { (_, u) -> u.destroy() } renderTargetCache.forEach { (_, u) -> u.destroy() }
renderTargetCache.clear() renderTargetCache.clear()
} }
}
private fun drawElement(element: Element, drawer: Drawer, zIndex: Int, zComp: Int) { private fun drawElement(element: Element, drawer: Drawer, zIndex: Int, zComp: Int) {
val newZComp = val newZComp =