mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibWeb: Preserve unit when serializing angle values
Previously, when serializing an angle value, we would always convert it to degrees. We now canonicalize the angle value only when serializing its computed value.
This commit is contained in:
parent
d0be5a0cdf
commit
5bfbb7abe6
Notes:
github-actions[bot]
2025-03-20 17:00:27 +00:00
Author: https://github.com/tcl3
Commit: 5bfbb7abe6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4004
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 20 additions and 19 deletions
|
@ -29,7 +29,7 @@ Angle Angle::percentage_of(Percentage const& percentage) const
|
|||
|
||||
String Angle::to_string() const
|
||||
{
|
||||
return MUST(String::formatted("{}deg", to_degrees()));
|
||||
return MUST(String::formatted("{}{}", raw_value(), unit_name()));
|
||||
}
|
||||
|
||||
double Angle::to_degrees() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue