mirror of
https://github.com/typst/typst
synced 2025-07-27 22:37:54 +08:00
Compare commits
2 Commits
bbf111f59d
...
1ad7ac0973
Author | SHA1 | Date | |
---|---|---|---|
|
1ad7ac0973 | ||
|
ed5f85e0cd |
@ -93,7 +93,7 @@ struct State<'a> {
|
|||||||
size: Size,
|
size: Size,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl State<'_> {
|
impl<'a> State<'a> {
|
||||||
fn new(size: Size, transform: sk::Transform, pixel_per_pt: f32) -> Self {
|
fn new(size: Size, transform: sk::Transform, pixel_per_pt: f32) -> Self {
|
||||||
Self {
|
Self {
|
||||||
size,
|
size,
|
||||||
@ -128,9 +128,10 @@ impl State<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the current mask.
|
/// Sets the current mask.
|
||||||
fn with_mask(self, mask: Option<&sk::Mask>) -> State<'_> {
|
///
|
||||||
// Ensure that we're using the parent's mask if we don't have one.
|
/// If no mask is provided, the parent mask is used.
|
||||||
if mask.is_some() { State { mask, ..self } } else { State { mask: None, ..self } }
|
fn with_mask(self, mask: Option<&'a sk::Mask>) -> State<'a> {
|
||||||
|
State { mask: mask.or(self.mask), ..self }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the size of the first hard frame in the hierarchy.
|
/// Sets the size of the first hard frame in the hierarchy.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user