Scale Viewer status by backing scale.
The Viewer status box 's' is quite small on high resolution displays.
The 'u' key doubles its size and has been used as a work-around, but
let the status box scale take the backing scale into account.
Change-Id: I98db37a4ed86698ba7c02666478dff248ff6daae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374377
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 23c23b87..1f35021 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -378,6 +378,7 @@
fRefresh = FLAGS_redraw;
fImGuiLayer.setScaleFactor(fWindow->scaleFactor());
+ fStatsLayer.setDisplayScale((fZoomUI ? 2.0f : 1.0f) * fWindow->scaleFactor());
// Configure timers
fStatsLayer.setActive(FLAGS_stats);
@@ -668,7 +669,7 @@
});
fCommands.addCommand('u', "GUI", "Zoom UI", [this]() {
fZoomUI = !fZoomUI;
- fStatsLayer.setDisplayScale(fZoomUI ? 2.0f : 1.0f);
+ fStatsLayer.setDisplayScale((fZoomUI ? 2.0f : 1.0f) * fWindow->scaleFactor());
fWindow->inval();
});
fCommands.addCommand('$', "ViaSerialize", "Toggle ViaSerialize", [this]() {