Merge remote-tracking branch 'Exter-N/allow-intentional-zero-gloss' into API9

This commit is contained in:
Ottermandias 2023-09-28 18:13:07 +02:00
commit 4e40ed3be4

View file

@ -348,10 +348,11 @@ public partial class ModEditWindow
ImGui.TableNextColumn(); ImGui.TableNextColumn();
tmpFloat = row.GlossStrength; tmpFloat = row.GlossStrength;
ImGui.SetNextItemWidth(floatSize); ImGui.SetNextItemWidth(floatSize);
if (ImGui.DragFloat("##GlossStrength", ref tmpFloat, Math.Max(0.1f, tmpFloat * 0.025f), HalfEpsilon, HalfMaxValue, "%.1f") float glossStrengthMin = ImGui.GetIO().KeyCtrl ? 0.0f : HalfEpsilon;
if (ImGui.DragFloat("##GlossStrength", ref tmpFloat, Math.Max(0.1f, tmpFloat * 0.025f), glossStrengthMin, HalfMaxValue, "%.1f")
&& FixFloat(ref tmpFloat, row.GlossStrength)) && FixFloat(ref tmpFloat, row.GlossStrength))
{ {
row.GlossStrength = Math.Max(tmpFloat, HalfEpsilon); row.GlossStrength = Math.Max(tmpFloat, glossStrengthMin);
ret = true; ret = true;
tab.UpdateColorTableRowPreview(rowIdx); tab.UpdateColorTableRowPreview(rowIdx);
} }