mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
gfx: Add elliptical border radius support
This commit is contained in:
parent
7474b29510
commit
3e5fb49b6f
9 changed files with 603 additions and 305 deletions
|
@ -8,12 +8,12 @@
|
|||
|
||||
use fragment::Fragment;
|
||||
|
||||
use euclid::{Matrix4, SideOffsets2D};
|
||||
use euclid::{Matrix4, SideOffsets2D, Size2D};
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use style::computed_values::transform::ComputedMatrix;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto};
|
||||
use style::values::computed::{LengthOrPercentageOrNone, LengthOrPercentage};
|
||||
use util::geometry::Au;
|
||||
use util::logical_geometry::LogicalMargin;
|
||||
|
@ -420,6 +420,13 @@ pub fn specified(length: LengthOrPercentage, containing_length: Au) -> Au {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn specified_border_radius(radius: BorderRadiusSize, containing_length: Au) -> Size2D<Au> {
|
||||
let BorderRadiusSize(size) = radius;
|
||||
let w = specified(size.width, containing_length);
|
||||
let h = specified(size.height, containing_length);
|
||||
Size2D::new(w, h)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn padding_from_style(style: &ComputedValues, containing_block_inline_size: Au)
|
||||
-> LogicalMargin<Au> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue