refactor(new_editor): continue architecture closeout
This commit is contained in:
@@ -196,41 +196,6 @@ void AppendSelectedTabBottomBorderMask(
|
||||
0.0f);
|
||||
}
|
||||
|
||||
UIEditorTabStripInsertionPreview BuildInsertionPreview(
|
||||
const UIEditorTabStripLayout& layout,
|
||||
const UIEditorTabStripState& state,
|
||||
const UIEditorTabStripMetrics& metrics) {
|
||||
UIEditorTabStripInsertionPreview preview = {};
|
||||
if (!state.reorder.dragging ||
|
||||
state.reorder.previewInsertionIndex == UIEditorTabStripInvalidIndex ||
|
||||
layout.tabHeaderRects.empty() ||
|
||||
state.reorder.previewInsertionIndex > layout.tabHeaderRects.size() ||
|
||||
layout.headerRect.height <= 0.0f) {
|
||||
return preview;
|
||||
}
|
||||
|
||||
float indicatorX = layout.tabHeaderRects.front().x;
|
||||
if (state.reorder.previewInsertionIndex >= layout.tabHeaderRects.size()) {
|
||||
const UIRect& lastRect = layout.tabHeaderRects.back();
|
||||
indicatorX = lastRect.x + lastRect.width;
|
||||
} else {
|
||||
indicatorX = layout.tabHeaderRects[state.reorder.previewInsertionIndex].x;
|
||||
}
|
||||
|
||||
const float thickness = (std::max)(ClampNonNegative(metrics.reorderPreviewThickness), 1.0f);
|
||||
const float insetY = ClampNonNegative(metrics.reorderPreviewInsetY);
|
||||
const float indicatorHeight = (std::max)(layout.headerRect.height - insetY * 2.0f, thickness);
|
||||
|
||||
preview.visible = true;
|
||||
preview.insertionIndex = state.reorder.previewInsertionIndex;
|
||||
preview.indicatorRect = UIRect(
|
||||
indicatorX - thickness * 0.5f,
|
||||
layout.headerRect.y + insetY,
|
||||
thickness,
|
||||
indicatorHeight);
|
||||
return preview;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
float ResolveUIEditorTabStripDesiredHeaderLabelWidth(
|
||||
@@ -287,9 +252,6 @@ UIEditorTabStripLayout BuildUIEditorTabStripLayout(
|
||||
layout.headerRect = arranged.headerRect;
|
||||
layout.contentRect = arranged.contentRect;
|
||||
layout.tabHeaderRects = arranged.tabHeaderRects;
|
||||
layout.closeButtonRects.resize(items.size());
|
||||
layout.showCloseButtons.resize(items.size(), false);
|
||||
layout.insertionPreview = BuildInsertionPreview(layout, state, metrics);
|
||||
return layout;
|
||||
}
|
||||
|
||||
@@ -361,12 +323,6 @@ void AppendUIEditorTabStripBackground(
|
||||
}
|
||||
}
|
||||
|
||||
if (layout.insertionPreview.visible) {
|
||||
drawList.AddFilledRect(
|
||||
layout.insertionPreview.indicatorRect,
|
||||
palette.reorderPreviewColor,
|
||||
0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void AppendUIEditorTabStripForeground(
|
||||
|
||||
Reference in New Issue
Block a user