From a0340a638df36ef8f8b589fd32c9833f50b46a2d Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 26 Mar 2020 22:07:58 +0100 Subject: [PATCH] Ensure texture exists in 2d view --- Sources/arm/ui/UISidebar.hx | 1 + Sources/arm/ui/UIView2D.hx | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/arm/ui/UISidebar.hx b/Sources/arm/ui/UISidebar.hx index e862232e..1e7e18a2 100644 --- a/Sources/arm/ui/UISidebar.hx +++ b/Sources/arm/ui/UISidebar.hx @@ -853,6 +853,7 @@ class UISidebar { if (UIView2D.inst.type != type) UIView2D.inst.show = true; else UIView2D.inst.show = !UIView2D.inst.show; UIView2D.inst.type = type; + UIView2D.inst.hwnd.redraws = 2; App.resize(); } diff --git a/Sources/arm/ui/UIView2D.hx b/Sources/arm/ui/UIView2D.hx index 5f53aca3..378016ee 100644 --- a/Sources/arm/ui/UIView2D.hx +++ b/Sources/arm/ui/UIView2D.hx @@ -126,15 +126,14 @@ class UIView2D { var th = tw; if (tex != null) { th = tw * (tex.height / tex.width); - } - - if (type == View2DLayer) { - ui.g.pipeline = pipe; - drawLayer(tex, tx, ty, tw, th, channel); - ui.g.pipeline = null; - } - else { - ui.g.drawScaledImage(tex, tx, ty, tw, th); + if (type == View2DLayer) { + ui.g.pipeline = pipe; + drawLayer(tex, tx, ty, tw, th, channel); + ui.g.pipeline = null; + } + else { + ui.g.drawScaledImage(tex, tx, ty, tw, th); + } } // UV map