aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-08-11 22:21:59 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-08-11 22:21:59 +0200
commit8a360e32ac3136494a494379a6dbbacef6f95da2 (patch)
treed22221d3d666f61642801abc3909144dfa25959f /src/styleengine.cc
parent8465e4686ff128a40be4807fce481b16c9b38a8e (diff)
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
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 6aa99910..5fe410b6 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);