爆修
This commit is contained in:
@@ -97,7 +97,7 @@ namespace Ichni.Editor
|
||||
Ichni.Editor.Commands.CommandManager.ExecuteCommand(new Ichni.Editor.Commands.ChangeValueCommand(connectedBaseElement, colorParameterName, emissionColor));
|
||||
|
||||
colorPreview.color = emissionColor;
|
||||
//connectedBaseElement.Refresh();
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
|
||||
public void SliderChange(float value)
|
||||
|
||||
@@ -197,10 +197,12 @@ namespace Ichni.Editor
|
||||
return highest;
|
||||
}
|
||||
|
||||
private static float SmartInferHeight(Type t)
|
||||
private static float SmartInferHeight(FieldDef fd)
|
||||
{
|
||||
if (t == typeof(Color)) return 240f;
|
||||
// 多数基础组件默认为 100 单位高度
|
||||
// EmissionColorPicker 有 Toggle/RGB滑块/Intensity输入框,高度明显大于 BaseColorPicker
|
||||
if (fd.Attr is DynamicUIEmissionColorAttribute) return 320f;
|
||||
if (fd.ValueType == typeof(Color)) return 280f;
|
||||
// 多数基础组件默认为 100
|
||||
return 100f;
|
||||
}
|
||||
|
||||
@@ -209,7 +211,7 @@ namespace Ichni.Editor
|
||||
float highest = 100f;
|
||||
foreach (var f in fields)
|
||||
{
|
||||
float height = f.Attr.Height > 0 ? f.Attr.Height : SmartInferHeight(f.ValueType);
|
||||
float height = f.Attr.Height > 0 ? f.Attr.Height : SmartInferHeight(f);
|
||||
if (height > highest) highest = height;
|
||||
}
|
||||
return highest;
|
||||
|
||||
Reference in New Issue
Block a user