diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-11-08 23:42:34 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-11-08 23:42:45 +0100 |
| commit | 7f0fcda3764e261612021e5ec66d536bb5ee98ef (patch) | |
| tree | 496449a9a3111b2108a068087c56281b4d47e519 /crates/typst-library/src/visualize | |
| parent | d7fea7077ebe4df44edff32b2b3a6e4a00775974 (diff) | |
Move some things out of `util`
Diffstat (limited to 'crates/typst-library/src/visualize')
| -rw-r--r-- | crates/typst-library/src/visualize/image.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/typst-library/src/visualize/image.rs b/crates/typst-library/src/visualize/image.rs index 6e166bc0..7f0b8289 100644 --- a/crates/typst-library/src/visualize/image.rs +++ b/crates/typst-library/src/visualize/image.rs @@ -1,7 +1,5 @@ use std::ffi::OsStr; -use std::path::Path; -use typst::geom::{self, Smart}; use typst::image::{Image, ImageFormat, RasterFormat, VectorFormat}; use typst::util::option_eq; @@ -135,7 +133,7 @@ impl Layout for ImageElem { let format = match self.format(styles) { Smart::Custom(v) => v, Smart::Auto => { - let ext = Path::new(self.path().as_str()) + let ext = std::path::Path::new(self.path().as_str()) .extension() .and_then(OsStr::to_str) .unwrap_or_default() @@ -213,7 +211,7 @@ impl Layout for ImageElem { // Create a clipping group if only part of the image should be visible. if fit == ImageFit::Cover && !target.fits(fitted) { - frame.clip(geom::Path::rect(frame.size())); + frame.clip(Path::rect(frame.size())); } // Apply metadata. |
