From 6ddba5f0ad9c01e955ad2f5048c932476b7360b0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 9 Jun 2016 10:46:08 -0700 Subject: [PATCH] Don't default to max zoom when there's no current texture. --- renderdocui/Windows/TextureViewer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index 9ae3a3da2..7e4eb426f 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -2387,6 +2387,8 @@ namespace renderdocui.Windows private float GetFitScale() { + if (CurrentTexture == null) + return 1.0f; float xscale = (float)render.Width / (float)CurrentTexDisplayWidth; float yscale = (float)render.Height / (float)CurrentTexDisplayHeight; return Math.Min(xscale, yscale);