Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5762)

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 1581883003: Use float literals to decide when to blacklist low scaling factors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compare against the original scaling factor, not the rounded one Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index f3e98fc104a82714fb25abd23b71aa573749654b..cc4c6b8c0df87a758e5bfaed5e10ba228e1e7472 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -1352,10 +1352,10 @@ float Gtk2UI::GetDeviceScaleFactor() const {
return gfx::Display::GetForcedDeviceScaleFactor();
const int kCSSDefaultDPI = 96;
const float scale = GetDPI() / kCSSDefaultDPI;
- // Round to 1 decimal, e.g. to 1.4.
- const float rounded = roundf(scale * 10) / 10;
- // See crbug.com/484400
- return rounded < 1.3 ? 1.0 : rounded;
+
+ // Blacklist scaling factors <130% (crbug.com/484400) and round
+ // to 1 decimal to prevent rendering problems (crbug.com/485183).
+ return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10;
}
} // namespace libgtk2ui
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698