Set texture viewer status bar to fixed width font. Partly experimental

* Since the addition of the normalised UV co-ords the status bar will
  flicker in width horrendously when scanning over a texture and it's
  impossible to track where you are. Even worse, if the text is wide
  enough (or the window narrow enough) you'll end up with the status
  bar flickering between one and two lines - which is awful.
* For now I've added some padding for numbers and set a fixed width font
  so the only varying element is the actual texel value, which is
  unavoidable in the general case. The text is probably wider overall
  so I'll need to see what feedback I get.
This commit is contained in:
baldurk
2015-02-10 17:37:08 +00:00
parent 3f5d87f290
commit 424f5ab964
2 changed files with 15 additions and 7 deletions
+2
View File
@@ -329,6 +329,7 @@
//
// statusLabel
//
this.statusLabel.Font = new System.Drawing.Font("Consolas", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(63, 13);
this.statusLabel.Text = "Status Text";
@@ -914,6 +915,7 @@
//
// texStatusDim
//
this.texStatusDim.Font = new System.Drawing.Font("Consolas", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.texStatusDim.Name = "texStatusDim";
this.texStatusDim.Size = new System.Drawing.Size(71, 13);
this.texStatusDim.Text = "texStatusDim";
+13 -7
View File
@@ -1435,16 +1435,18 @@ namespace renderdocui.Windows
int y = m_CurHoverPixel.Y >> (int)m_TexDisplay.mip;
if (m_Core.APIProps.pipelineType == APIPipelineStateType.OpenGL)
y = (int)(tex.height-1) - y;
y = (int)(tex.height - 1) - y;
if (m_TexDisplay.FlipY)
y = (int)(tex.height-1) - y;
y = (int)(tex.height - 1) - y;
y = Math.Max(0, y);
int x = m_CurHoverPixel.X >> (int)m_TexDisplay.mip;
float invWidth = tex.width > 0 ? 1.0f / tex.width : 0.0f;
float invHeight = tex.height > 0 ? 1.0f /tex.height : 0.0f;
string hoverCoords = String.Format("{0}, {1}, ({2}, {3})",
x, y, Formatter.Format(x * invWidth), Formatter.Format(y * invHeight));
string hoverCoords = String.Format("{0,4}, {1,4} ({2:0.0000}, {3:0.0000})",
x, y, (x * invWidth), (y * invHeight));
string statusText = "Hover - " + hoverCoords;
@@ -1453,12 +1455,16 @@ namespace renderdocui.Windows
if (m_CurPixelValue != null)
{
x = m_PickedPoint.X >> (int)m_TexDisplay.mip;
y = m_PickedPoint.Y >> (int)m_TexDisplay.mip;
if (m_Core.APIProps.pipelineType == APIPipelineStateType.OpenGL)
y = (int)(tex.height - 1) - y;
if (m_TexDisplay.FlipY)
y = (int)tex.height - y;
y = (int)(tex.height - 1) - y;
statusText += " - Right click - " +
(m_PickedPoint.X >> (int)m_TexDisplay.mip) + "," + y + ": ";
y = Math.Max(0, y);
statusText += " - Right click - " + String.Format("{0,4}, {1,4}: ", x, y);
PixelValue val = m_CurPixelValue;