Refine XCEditor docking and DPI rendering

This commit is contained in:
2026-04-11 17:07:37 +08:00
parent 35d3d6328b
commit 2958dcc491
46 changed files with 4839 additions and 471 deletions

View File

@@ -110,21 +110,13 @@ UIColor ResolveSurfaceBorderColor(
return palette.surfaceCapturedBorderColor;
}
if (state.surfaceActive) {
return palette.surfaceActiveBorderColor;
}
if (state.surfaceHovered) {
return palette.surfaceHoveredBorderColor;
}
return palette.surfaceBorderColor;
}
float ResolveSurfaceBorderThickness(
const UIEditorViewportSlotState& state,
const UIEditorViewportSlotMetrics& metrics) {
if (state.inputCaptured || state.focused) {
if (state.inputCaptured) {
return metrics.focusedSurfaceBorderThickness;
}
@@ -356,8 +348,8 @@ void AppendUIEditorViewportSlotBackground(
drawList.AddFilledRect(layout.bounds, palette.frameColor, metrics.cornerRounding);
drawList.AddRectOutline(
layout.bounds,
state.focused ? palette.focusedBorderColor : palette.borderColor,
state.focused ? metrics.focusedBorderThickness : metrics.outerBorderThickness,
palette.borderColor,
metrics.outerBorderThickness,
metrics.cornerRounding);
if (layout.hasTopBar) {
@@ -366,12 +358,6 @@ void AppendUIEditorViewportSlotBackground(
drawList.AddFilledRect(layout.surfaceRect, palette.surfaceColor);
if (state.surfaceHovered) {
drawList.AddFilledRect(layout.inputRect, palette.surfaceHoverOverlayColor);
}
if (state.surfaceActive) {
drawList.AddFilledRect(layout.inputRect, palette.surfaceActiveOverlayColor);
}
if (state.inputCaptured) {
drawList.AddFilledRect(layout.inputRect, palette.captureOverlayColor);
}