client: Fix invalid conversion from points to pixels
CSS and WebKit expects font size in pixels, but not "actual device pixels". This fixes incorrect font size when using font-scaling with WebKitGTK >= 2.48. Under older WebKitGTK versions result will be the same. Refs https://github.com/WebKit/WebKit/pull/40412#issuecomment-2690897270
This commit is contained in:
parent
1f5cfb73e0
commit
851f188a06
1 changed files with 1 additions and 3 deletions
|
|
@ -192,13 +192,11 @@ public abstract class Components.WebView : WebKit.WebView, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
private static inline uint to_wk2_font_size(Pango.FontDescription font) {
|
||||
Gdk.Screen? screen = Gdk.Screen.get_default();
|
||||
double dpi = screen != null ? screen.get_resolution() : 96.0;
|
||||
double size = font.get_size();
|
||||
if (!font.get_size_is_absolute()) {
|
||||
size = size / Pango.SCALE;
|
||||
}
|
||||
return (uint) (size * dpi / 72.0);
|
||||
return (uint) WebKit.Settings.font_size_to_pixels((uint) size);
|
||||
}
|
||||
|
||||
private static inline double get_text_scale () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue