diff options
Diffstat (limited to 'library/src/graphics')
| -rw-r--r-- | library/src/graphics/hide.rs | 2 | ||||
| -rw-r--r-- | library/src/graphics/image.rs | 4 | ||||
| -rw-r--r-- | library/src/graphics/line.rs | 2 | ||||
| -rw-r--r-- | library/src/graphics/shape.rs | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/library/src/graphics/hide.rs b/library/src/graphics/hide.rs index 0fdb8638..f79b31ae 100644 --- a/library/src/graphics/hide.rs +++ b/library/src/graphics/hide.rs @@ -6,7 +6,7 @@ pub struct HideNode(pub Content); #[node(LayoutInline)] impl HideNode { - fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { + fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { Ok(Self(args.expect("body")?).pack()) } } diff --git a/library/src/graphics/image.rs b/library/src/graphics/image.rs index 12121257..202abebe 100644 --- a/library/src/graphics/image.rs +++ b/library/src/graphics/image.rs @@ -14,12 +14,12 @@ impl ImageNode { /// How the image should adjust itself to a given area. pub const FIT: ImageFit = ImageFit::Cover; - fn construct(vm: &mut Vm, args: &mut Args) -> SourceResult<Content> { + fn construct(vm: &Vm, args: &mut Args) -> SourceResult<Content> { let Spanned { v: path, span } = args.expect::<Spanned<EcoString>>("path to image file")?; let full = vm.locate(&path).at(span)?; - let buffer = vm.world.file(&full).at(span)?; + let buffer = vm.world().file(&full).at(span)?; let ext = full.extension().and_then(OsStr::to_str).unwrap_or_default(); let format = match ext.to_lowercase().as_str() { "png" => ImageFormat::Raster(RasterFormat::Png), diff --git a/library/src/graphics/line.rs b/library/src/graphics/line.rs index 112274d2..e7c347b2 100644 --- a/library/src/graphics/line.rs +++ b/library/src/graphics/line.rs @@ -15,7 +15,7 @@ impl LineNode { #[property(resolve, fold)] pub const STROKE: PartialStroke = PartialStroke::default(); - fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { + fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { let origin = args.named("origin")?.unwrap_or_default(); let delta = match args.named::<Axes<Rel<Length>>>("to")? { diff --git a/library/src/graphics/shape.rs b/library/src/graphics/shape.rs index d484b993..ebdc1717 100644 --- a/library/src/graphics/shape.rs +++ b/library/src/graphics/shape.rs @@ -38,7 +38,7 @@ impl<const S: ShapeKind> ShapeNode<S> { #[property(skip, resolve, fold)] pub const RADIUS: Corners<Option<Rel<Length>>> = Corners::splat(Rel::zero()); - fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { + fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { let size = match S { SQUARE => args.named::<Length>("size")?.map(Rel::from), CIRCLE => args.named::<Length>("radius")?.map(|r| 2.0 * Rel::from(r)), |
