Summary: | [GTK] Simplify the code to adjust font sizes depending on screen DPI | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | gustavo, mrobinson, pnormand, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2012-03-01 09:28:14 PST
I don't believe that WebKit2 needs to use this code. Created attachment 129715 [details]
Patch
Attachment 129715 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'LayoutTests/ChangeLog', u'La..." exit_code: 1
WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h"
Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp:71: Use 0 instead of NULL. [readability/null] [5]
Total errors found: 1 in 193 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Ok, I didn't know we didn't wat to use the screen dpi in wk2, the patch still makes the wk1 code a lot simpler and cleaner IMO. Comment on attachment 129715 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129715&action=review > Source/WebCore/platform/gtk/GtkUtilities.cpp:65 > + static const double kMillimetresPerInch = 25.4; > + double diagonalSizeInPixels = hypot(gdk_screen_get_width(screen), gdk_screen_get_height(screen)); > + double diagonalSizeInInches = hypot(gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm(screen)) / kMillimetresPerInch; > + return diagonalSizeInPixels / diagonalSizeInInches; I like the way you're falling back here. Created attachment 129723 [details]
Updated patch
Moved the code from web core back to webkit but leaving the cleaner code.
Committed r109517: <http://trac.webkit.org/changeset/109517> |