From 8a360e32ac3136494a494379a6dbbacef6f95da2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sun, 11 Aug 2024 22:21:59 +0200 Subject: [PATCH] Round CSS value after applying zoom level When a 1px value is used for the border, any zoom level that makes it smaller makes the resulting size 0, so it disappears. Using round instead leaves more room for zooming out before it disappears. Fixes: https://github.com/dillo-browser/dillo/issues/240 --- src/styleengine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styleengine.cc b/src/styleengine.cc index 6aa99910b..5fe410b66 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -791,7 +791,7 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, bool StyleEngine::computeValue (int *dest, CssLength value, Font *font) { switch (CSS_LENGTH_TYPE (value)) { case CSS_LENGTH_TYPE_PX: - *dest = (int) (CSS_LENGTH_VALUE (value) * zoom); + *dest = roundInt (CSS_LENGTH_VALUE (value) * zoom); return true; case CSS_LENGTH_TYPE_MM: *dest = roundInt (CSS_LENGTH_VALUE (value) * dpmm * zoom);