mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Don't allow direct writes to RangeMax/RangeMin that can break things
* The old code in m_RangeMax/m_RangeMin setters wasn't doing proper epsilon enforcing so min=max could end up happening. It's easier to set both at once (this is all we care about anyway) so that it does properly make the min and max distinguishable.
This commit is contained in:
@@ -183,13 +183,6 @@ namespace renderdocui.Controls
|
||||
{
|
||||
return m_RangeMin;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_RangeMin = Math.Min(value, m_RangeMax - MinRangeSize);
|
||||
|
||||
Invalidate();
|
||||
OnRangeUpdated(new RangeHistogramEventArgs(BlackPoint, WhitePoint));
|
||||
}
|
||||
}
|
||||
[Browsable(false)]
|
||||
public float RangeMax
|
||||
@@ -198,13 +191,6 @@ namespace renderdocui.Controls
|
||||
{
|
||||
return m_RangeMax;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_RangeMax = Math.Max(value, m_RangeMin + MinRangeSize);
|
||||
|
||||
Invalidate();
|
||||
OnRangeUpdated(new RangeHistogramEventArgs(BlackPoint, WhitePoint));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
-2
@@ -1267,8 +1267,6 @@
|
||||
this.rangeHistogram.MinimumSize = new System.Drawing.Size(200, 20);
|
||||
this.rangeHistogram.MinRangeSize = 1E-06F;
|
||||
this.rangeHistogram.Name = "rangeHistogram";
|
||||
this.rangeHistogram.RangeMax = 1F;
|
||||
this.rangeHistogram.RangeMin = 0F;
|
||||
this.rangeHistogram.Size = new System.Drawing.Size(200, 20);
|
||||
this.rangeHistogram.TabIndex = 2;
|
||||
this.rangeHistogram.WhitePoint = 1F;
|
||||
|
||||
@@ -1440,10 +1440,7 @@ namespace renderdocui.Windows
|
||||
// reset the range if desired
|
||||
if (m_Core.Config.TextureViewer_ResetRange)
|
||||
{
|
||||
rangeHistogram.RangeMin = 0.0f;
|
||||
rangeHistogram.RangeMax = 1.0f;
|
||||
rangeHistogram.BlackPoint = 0.0f;
|
||||
rangeHistogram.WhitePoint = 1.0f;
|
||||
rangeHistogram.SetRange(0.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2748,8 +2745,7 @@ namespace renderdocui.Windows
|
||||
|
||||
autoFit.Checked = false;
|
||||
|
||||
rangeHistogram.RangeMin = black;
|
||||
rangeHistogram.RangeMax = white;
|
||||
rangeHistogram.SetRange(black, white);
|
||||
|
||||
m_Core.Renderer.BeginInvoke(RT_UpdateVisualRange);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user