mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
LibWeb: Add CSSPixels::nearest_value_for(FloatingPoint)
This is intended to annotate conversions from unknown floating-point values to CSSPixels, and make it more obvious the fp value will be rounded to the nearest fixed-point value.
This commit is contained in:
parent
360c0eb509
commit
71baa8c31a
28 changed files with 120 additions and 112 deletions
|
@ -25,7 +25,7 @@ void ButtonBox::prepare_for_replaced_layout()
|
|||
// value attribute. This is not the case with <button />, which contains
|
||||
// its contents normally.
|
||||
if (is<HTML::HTMLInputElement>(dom_node())) {
|
||||
set_natural_width(CSSPixels(font().width(static_cast<HTML::HTMLInputElement&>(dom_node()).value())));
|
||||
set_natural_width(CSSPixels::nearest_value_for(font().width(static_cast<HTML::HTMLInputElement&>(dom_node()).value())));
|
||||
set_natural_height(font().pixel_size_rounded_up());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue