aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-05-01 15:35:36 +1000
committerNeil <nyamatongwe@gmail.com>2020-05-01 15:35:36 +1000
commita6488e4ec7b8163fae0d4d232452b5896937bb6e (patch)
tree11c412831eb606b6b503c85d1dec8d05513987f7
parent4fcd84b4be9b60ab5903f9022093e34c1f14963e (diff)
downloadscintilla-mirror-a6488e4ec7b8163fae0d4d232452b5896937bb6e.tar.gz
Backport: Bug [#2173]. Tweak font measurement so underscores more likely visible.
Backport of changeset 8219:69ebdfc2513e.
-rwxr-xr-xgtk/PlatGTK.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 680caf081..0ffddbe74 100755
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -923,7 +923,7 @@ XYPOSITION SurfaceImpl::Ascent(Font &font_) {
if (PFont(font_)->pfd) {
PangoFontMetrics *metrics = pango_context_get_metrics(pcontext,
PFont(font_)->pfd, pango_context_get_language(pcontext));
- ascent = std::floor(floatFromPangoUnits(
+ ascent = Sci::round(floatFromPangoUnits(
pango_font_metrics_get_ascent(metrics)));
pango_font_metrics_unref(metrics);
}
@@ -939,7 +939,7 @@ XYPOSITION SurfaceImpl::Descent(Font &font_) {
if (PFont(font_)->pfd) {
PangoFontMetrics *metrics = pango_context_get_metrics(pcontext,
PFont(font_)->pfd, pango_context_get_language(pcontext));
- const XYPOSITION descent = std::floor(floatFromPangoUnits(
+ const XYPOSITION descent = Sci::round(floatFromPangoUnits(
pango_font_metrics_get_descent(metrics)));
pango_font_metrics_unref(metrics);
return descent;