mirror of
https://github.com/typst/typst
synced 2025-07-27 14:27:56 +08:00
Compare commits
3 Commits
1ad7ac0973
...
bbf111f59d
Author | SHA1 | Date | |
---|---|---|---|
|
bbf111f59d | ||
|
78355421ad | ||
|
ed5f85e0cd |
@ -834,7 +834,7 @@ fn param_value_completions<'a>(
|
||||
fn path_completion(func: &Func, param: &ParamInfo) -> Option<&'static [&'static str]> {
|
||||
Some(match (func.name(), param.name) {
|
||||
(Some("image"), "source") => {
|
||||
&["png", "jpg", "jpeg", "gif", "svg", "svgz", "webp"]
|
||||
&["png", "jpg", "jpeg", "gif", "svg", "svgz", "webp", "pdf"]
|
||||
}
|
||||
(Some("csv"), "source") => &["csv"],
|
||||
(Some("plugin"), "source") => &["wasm"],
|
||||
|
@ -93,7 +93,7 @@ struct State<'a> {
|
||||
size: Size,
|
||||
}
|
||||
|
||||
impl State<'_> {
|
||||
impl<'a> State<'a> {
|
||||
fn new(size: Size, transform: sk::Transform, pixel_per_pt: f32) -> Self {
|
||||
Self {
|
||||
size,
|
||||
@ -128,9 +128,10 @@ impl State<'_> {
|
||||
}
|
||||
|
||||
/// 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 mask.is_some() { State { mask, ..self } } else { State { mask: None, ..self } }
|
||||
///
|
||||
/// If no mask is provided, the parent mask is used.
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user