fix(console): DPI-scale the toolbar status-dot offsets
The status indicator's left inset (+2) and dot-to-text reservation (+6) were raw pixels while the dot radius is DPI-scaled, so the dot shifted a couple native px at HiDPI. Multiply both by Layout::dpiScale() per the project's hand-drawn-geometry rule. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -611,7 +611,7 @@ void ConsoleTab::drawToolbarStatus(ConsoleCommandExecutor& exec)
|
|||||||
ImVec2 cp = ImGui::GetCursorScreenPos();
|
ImVec2 cp = ImGui::GetCursorScreenPos();
|
||||||
float dotR = schema::UI().drawElement("tabs.console", "status-dot-radius-base").size + schema::UI().drawElement("tabs.console", "status-dot-radius-scale").size * Layout::hScale();
|
float dotR = schema::UI().drawElement("tabs.console", "status-dot-radius-base").size + schema::UI().drawElement("tabs.console", "status-dot-radius-scale").size * Layout::hScale();
|
||||||
float dotY = cp.y + ImGui::GetTextLineHeight() * 0.5f;
|
float dotY = cp.y + ImGui::GetTextLineHeight() * 0.5f;
|
||||||
float dotX = cp.x + dotR + 2;
|
float dotX = cp.x + dotR + 2.0f * Layout::dpiScale();
|
||||||
|
|
||||||
if (st.pulse) {
|
if (st.pulse) {
|
||||||
float a = schema::UI().drawElement("animations", "pulse-base-glow").size + schema::UI().drawElement("animations", "pulse-amp-glow").size * (float)std::sin((double)ImGui::GetTime() * schema::UI().drawElement("animations", "pulse-speed-fast").size);
|
float a = schema::UI().drawElement("animations", "pulse-base-glow").size + schema::UI().drawElement("animations", "pulse-amp-glow").size * (float)std::sin((double)ImGui::GetTime() * schema::UI().drawElement("animations", "pulse-speed-fast").size);
|
||||||
@@ -621,7 +621,7 @@ void ConsoleTab::drawToolbarStatus(ConsoleCommandExecutor& exec)
|
|||||||
dl->AddCircleFilled(ImVec2(dotX, dotY), dotR, st.color);
|
dl->AddCircleFilled(ImVec2(dotX, dotY), dotR, st.color);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(dotR * 2 + 6, 0));
|
ImGui::Dummy(ImVec2(dotR * 2 + 6.0f * Layout::dpiScale(), 0));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
Type().textColored(TypeStyle::Caption, st.color, st.text.c_str());
|
Type().textColored(TypeStyle::Caption, st.color, st.text.c_str());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user