diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-03-22 17:47:11 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-05-19 14:40:54 +0100 |
commit | ecf42afc3329b03ee642ede84f9ba224d2aff1e1 (patch) | |
tree | f147bfabd58888c1f9fd2bd98c14b840314eb5ed /src/select/unit.c | |
parent | 65d4fd6e83d421e7fa7a8c7df44d01797e3c69ae (diff) | |
download | libcss-ecf42afc3329b03ee642ede84f9ba224d2aff1e1.tar.gz libcss-ecf42afc3329b03ee642ede84f9ba224d2aff1e1.tar.bz2 |
Selection: Don't duplicate unit conversion members in media descriptor.
Diffstat (limited to 'src/select/unit.c')
-rw-r--r-- | src/select/unit.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/select/unit.c b/src/select/unit.c index a279ec7..9129d72 100644 --- a/src/select/unit.c +++ b/src/select/unit.c @@ -118,7 +118,7 @@ static inline css_fixed css_unit__absolute_len2pt( /* Exported function, documented in libcss/unit.h. */ css_fixed css_unit_font_size_len2pt( const css_computed_style *style, - const css_unit_len_ctx *ctx, + const css_unit_ctx *ctx, const css_fixed length, const css_unit unit) { @@ -279,22 +279,22 @@ static inline css_fixed css_unit__px_per_unit( /* Exported function, documented in unit.h. */ css_fixed css_unit_len2px_mq( - const css_media *media, + const css_unit_ctx *ctx, const css_fixed length, const css_unit unit) { /* In the media query context there is no reference or root element - * style, so these are hardcoded to NULL. */ + * style, so these are hard-coded to NULL. */ css_fixed px_per_unit = css_unit__px_per_unit( + ctx->measure, NULL, NULL, - NULL, - media->client_font_size, - INTTOFIX(0), - media->height, - media->width, + ctx->font_size_default, + ctx->font_size_minimum, + ctx->viewport_height, + ctx->viewport_width, unit, - NULL); + ctx->pw); /* Ensure we round px_per_unit to the nearest whole number of pixels: * the use of FIXTOINT() below will truncate. */ @@ -307,7 +307,7 @@ css_fixed css_unit_len2px_mq( /* Exported function, documented in libcss/unit.h. */ css_fixed css_unit_len2css_px( const css_computed_style *style, - const css_unit_len_ctx *ctx, + const css_unit_ctx *ctx, const css_fixed length, const css_unit unit) { @@ -333,7 +333,7 @@ css_fixed css_unit_len2css_px( /* Exported function, documented in libcss/unit.h. */ css_fixed css_unit_len2device_px( const css_computed_style *style, - const css_unit_len_ctx *ctx, + const css_unit_ctx *ctx, const css_fixed length, const css_unit unit) { |