Skip to content

Commit

Permalink
Round CSS value after applying zoom level
Browse files Browse the repository at this point in the history
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: #240
  • Loading branch information
rodarima committed Aug 11, 2024
1 parent 8465e46 commit 8a360e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/styleengine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8a360e3

Please sign in to comment.