@@ -262,6 +262,7 @@ void WaveformScope::DrawOverlay(ImDrawList* dl, const ScopeFrame& f, Settings& s
262262 const float top = f.graphP0 .y , bot = f.graphP1 .y ;
263263 const float left = f.graphP0 .x , right = f.graphP1 .x ;
264264 const float graphW = right - left, graphH = bot - top;
265+ const float u = UiScale ();
265266 auto inRange = [&](float y) { return y >= top - 0 .5f && y <= bot + 0 .5f ; };
266267
267268 const ImVec4 gc = ImVec4 (s.graticuleColor .x , s.graticuleColor .y , s.graticuleColor .z , s.graticuleOpacity );
@@ -284,7 +285,7 @@ void WaveformScope::DrawOverlay(ImDrawList* dl, const ScopeFrame& f, Settings& s
284285 for (int m = 2 ; m <= 9 ; ++m) {
285286 double n = dec * m; if (n > 10000.0 ) break ;
286287 float my = NitsToScreenY (n, f, s);
287- if (inRange (my)) dl->AddLine (ImVec2 (left - 20 .0f , my), ImVec2 (left, my), colMinor, 1 .0f );
288+ if (inRange (my)) dl->AddLine (ImVec2 (left - 20 .0f * u , my), ImVec2 (left, my), colMinor, 1 .0f );
288289 }
289290 }
290291
@@ -298,7 +299,7 @@ void WaveformScope::DrawOverlay(ImDrawList* dl, const ScopeFrame& f, Settings& s
298299 else snprintf (lab, sizeof (lab), " %g" , dec);
299300 ImVec2 ts = ImGui::CalcTextSize (lab);
300301 float ly = std::max (y - ts.y * 0 .5f , top);
301- dl->AddText (ImVec2 (left - 4 .0f - ts.x , ly), colText, lab);
302+ dl->AddText (ImVec2 (left - 4 .0f * u - ts.x , ly), colText, lab);
302303 }
303304
304305 // Extents white envelope line (style 1).
@@ -347,9 +348,9 @@ void WaveformScope::DrawOverlay(ImDrawList* dl, const ScopeFrame& f, Settings& s
347348 // Label sits inside the plot at the left edge, matching the graticule
348349 // labels' side (those live outside; keeping this inside avoids overlap).
349350 char lab[32 ]; snprintf (lab, sizeof (lab), " %.0f" , s.refLines [i].nits );
350- dl->AddText (ImVec2 (left + 6 .0f , y - 14 .0f ), col, lab);
351+ dl->AddText (ImVec2 (left + 6 .0f * u , y - ImGui::GetFontSize () - 1 .0f * u ), col, lab);
351352
352- if (hovered && io.MouseClicked [0 ] && fabsf (io.MousePos .y - y) < 5 .0f ) draggingRef_ = (int )i;
353+ if (hovered && io.MouseClicked [0 ] && fabsf (io.MousePos .y - y) < 5 .0f * u ) draggingRef_ = (int )i;
353354 }
354355 if (draggingRef_ >= 0 ) {
355356 if (io.MouseDown [0 ] && draggingRef_ < (int )s.refLines .size ())
@@ -362,8 +363,8 @@ void WaveformScope::DrawOverlay(ImDrawList* dl, const ScopeFrame& f, Settings& s
362363 char lab[32 ];
363364 FormatNits (std::clamp (ScreenYToNits (io.MousePos .y , f, s), 0.0 , 10000.0 ), lab, sizeof (lab));
364365 ImVec2 ts = ImGui::CalcTextSize (lab);
365- ImVec2 tp (io.MousePos .x + 14 .0f , io.MousePos .y - ts.y * 0 .5f );
366- if (tp.x + ts.x > right) tp.x = io.MousePos .x - ts.x - 10 .0f ;
366+ ImVec2 tp (io.MousePos .x + 14 .0f * u , io.MousePos .y - ts.y * 0 .5f );
367+ if (tp.x + ts.x > right) tp.x = io.MousePos .x - ts.x - 10 .0f * u ;
367368 tp.y = std::clamp (tp.y , top, bot - ts.y );
368369 dl->AddText (ImVec2 (tp.x + 1 , tp.y + 1 ), IM_COL32 (0 , 0 , 0 , 200 ), lab);
369370 dl->AddText (tp, IM_COL32 (235 , 235 , 235 , 230 ), lab);
@@ -393,6 +394,7 @@ void WaveformScope::DrawOverlay(ImDrawList* dl, const ScopeFrame& f, Settings& s
393394}
394395
395396void WaveformScope::DrawControls (Settings& s) {
397+ const float u = UiScale ();
396398 ImGui::RadioButton (" Luminance" , &s.waveMode , 0 );
397399 UiReset (s.waveMode , UiDefaults ().waveMode );
398400 UiTip (" One trace of overall brightness (luminance) per column." ); ImGui::SameLine ();
@@ -411,7 +413,7 @@ void WaveformScope::DrawControls(Settings& s) {
411413 ImGui::PushStyleColor (ImGuiCol_Button, c);
412414 ImGui::PushStyleColor (ImGuiCol_ButtonHovered, c);
413415 ImGui::PushStyleColor (ImGuiCol_ButtonActive, c);
414- if (ImGui::Button (names[i], ImVec2 (26 , 26 ))) s.channelEnabled [i] = !s.channelEnabled [i];
416+ if (ImGui::Button (names[i], ImVec2 (26 * u , 26 * u ))) s.channelEnabled [i] = !s.channelEnabled [i];
415417 UiReset (s.channelEnabled [i], true );
416418 ImGui::PopStyleColor (3 ); ImGui::PopID ();
417419 if (i < 2 ) ImGui::SameLine ();
@@ -428,7 +430,7 @@ void WaveformScope::DrawControls(Settings& s) {
428430 " trace is too faint to see - as colored points or a thin envelope line." );
429431 if (s.waveExtents ) {
430432 ImGui::SameLine ();
431- ImGui::SetNextItemWidth (150 );
433+ ImGui::SetNextItemWidth (150 * u );
432434 const char * styles[] = { " Colored points" , " White envelope line" };
433435 ImGui::Combo (" ##extstyle" , &s.waveExtentsStyle , styles, 2 );
434436 UiReset (s.waveExtentsStyle , UiDefaults ().waveExtentsStyle );
@@ -440,7 +442,7 @@ void WaveformScope::DrawControls(Settings& s) {
440442 UiTip (" Read every source pixel for the extents even when Quality samples "
441443 " a coarser grid, so single-pixel peaks can't slip through." );
442444 }
443- ImGui::SetNextItemWidth (150 );
445+ ImGui::SetNextItemWidth (150 * u );
444446 ImGui::SliderFloat (" Extents opacity" , &s.waveExtentsOpacity , 0 .0f , 1 .0f , " %.2f" );
445447 UiReset (s.waveExtentsOpacity , UiDefaults ().waveExtentsOpacity );
446448 }
@@ -457,17 +459,17 @@ void WaveformScope::DrawControls(Settings& s) {
457459 UiTip (" Smooth the trace across neighboring columns (Resolve-style low pass): "
458460 " exposure bands become easier to read, single-column spikes fade." );
459461 if (s.lowPass ) {
460- ImGui::SameLine (); ImGui::SetNextItemWidth (120 );
462+ ImGui::SameLine (); ImGui::SetNextItemWidth (120 * u );
461463 ImGui::SliderFloat (" Strength##lpa" , &s.lowPassAmount , 0 .0f , 1 .0f , " %.2f" );
462464 UiReset (s.lowPassAmount , UiDefaults ().lowPassAmount );
463465 }
464466
465467 // Reference lines: custom count, log drag (shift = 10x finer), thickness.
466468 ImGui::SeparatorText (" Reference lines" );
467- ImGui::SetNextItemWidth (120 );
469+ ImGui::SetNextItemWidth (120 * u );
468470 ImGui::SliderFloat (" Thickness" , &s.refLineThickness , 1 .0f , 6 .0f , " %.1f px" );
469471 UiReset (s.refLineThickness , UiDefaults ().refLineThickness );
470- ImGui::SetNextItemWidth (120 );
472+ ImGui::SetNextItemWidth (120 * u );
471473 ImGui::SliderFloat (" Opacity##ref" , &s.refLineOpacity , 0 .0f , 1 .0f , " %.2f" );
472474 UiReset (s.refLineOpacity , UiDefaults ().refLineOpacity );
473475 ImGuiIO& io = ImGui::GetIO ();
@@ -481,7 +483,7 @@ void WaveformScope::DrawControls(Settings& s) {
481483 ImGui::SameLine ();
482484 float v = (float )s.refLines [i].nits ;
483485 float speed = io.KeyShift ? 0 .02f : 0 .5f ; // hold Shift for 10x-finer control
484- ImGui::SetNextItemWidth (150 );
486+ ImGui::SetNextItemWidth (150 * u );
485487 if (ImGui::DragFloat (" nits" , &v, speed, 0 .0f , 10000 .0f , " %.2f" , ImGuiSliderFlags_Logarithmic))
486488 s.refLines [i].nits = std::clamp ((double )v, 0.0 , 10000.0 );
487489 UiReset (s.refLines [i].nits , defaultRef.nits );
0 commit comments