1- use crate :: application_io:: { TextureFrame , TextureFrameTable } ;
1+ use crate :: application_io:: { ImageTexture , TextureFrameTable } ;
22use crate :: instances:: Instances ;
33use crate :: raster:: image:: { Image , ImageFrameTable } ;
44use crate :: raster:: BlendMode ;
@@ -106,9 +106,9 @@ impl From<ImageFrameTable<Color>> for GraphicGroupTable {
106106 Self :: new ( GraphicGroup :: new ( vec ! [ GraphicElement :: RasterFrame ( RasterFrame :: ImageFrame ( image_frame) ) ] ) )
107107 }
108108}
109- impl From < TextureFrame > for GraphicGroupTable {
110- fn from ( texture_frame : TextureFrame ) -> Self {
111- Self :: new ( GraphicGroup :: new ( vec ! [ GraphicElement :: RasterFrame ( RasterFrame :: TextureFrame ( TextureFrameTable :: new( texture_frame ) ) ) ] ) )
109+ impl From < ImageTexture > for GraphicGroupTable {
110+ fn from ( image_texture : ImageTexture ) -> Self {
111+ Self :: new ( GraphicGroup :: new ( vec ! [ GraphicElement :: RasterFrame ( RasterFrame :: TextureFrame ( TextureFrameTable :: new( image_texture ) ) ) ] ) )
112112 }
113113}
114114impl From < TextureFrameTable > for GraphicGroupTable {
@@ -179,11 +179,14 @@ impl GraphicElement {
179179 }
180180}
181181
182+ // TODO: Rename to Raster
182183#[ derive( Clone , Debug , Hash , PartialEq , DynAny ) ]
183184pub enum RasterFrame {
184185 /// A CPU-based bitmap image with a finite position and extent, equivalent to the SVG <image> tag: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image
186+ // TODO: Rename to ImageTable
185187 ImageFrame ( ImageFrameTable < Color > ) ,
186188 /// A GPU texture with a finite position and extent
189+ // TODO: Rename to ImageTextureTable
187190 TextureFrame ( TextureFrameTable ) ,
188191}
189192
@@ -224,7 +227,7 @@ impl Artboard {
224227 pub fn new ( location : IVec2 , dimensions : IVec2 ) -> Self {
225228 Self {
226229 graphic_group : GraphicGroupTable :: default ( ) ,
227- label : String :: from ( "Artboard" ) ,
230+ label : "Artboard" . to_string ( ) ,
228231 location : location. min ( location + dimensions) ,
229232 dimensions : dimensions. abs ( ) ,
230233 background : Color :: WHITE ,
@@ -375,7 +378,8 @@ async fn append_artboard<C: Ctx + Clone + 'n>(
375378 let artboard = artboard. eval ( ctx) . await ;
376379 // let foot = ctx.footprint();
377380 // log::debug!("{:?}", foot);
378- // Get the penultimate element of the node path, or None if the path is too short
381+ // Get the penultimate element of the node path, or None if the path is too short.
382+ // This is used to get the ID of the user-facing "Artboard" node (which encapsulates this internal "Append Artboard" node).
379383 let encapsulating_node_id = node_path. get ( node_path. len ( ) . wrapping_sub ( 2 ) ) . copied ( ) ;
380384 artboards. append_artboard ( artboard, encapsulating_node_id) ;
381385
@@ -394,8 +398,8 @@ impl From<ImageFrameTable<Color>> for GraphicElement {
394398 }
395399}
396400// TODO: Remove this one
397- impl From < TextureFrame > for GraphicElement {
398- fn from ( texture : TextureFrame ) -> Self {
401+ impl From < ImageTexture > for GraphicElement {
402+ fn from ( texture : ImageTexture ) -> Self {
399403 GraphicElement :: RasterFrame ( RasterFrame :: TextureFrame ( TextureFrameTable :: new ( texture) ) )
400404 }
401405}
@@ -446,7 +450,7 @@ trait ToGraphicElement: Into<GraphicElement> {}
446450
447451impl ToGraphicElement for VectorDataTable { }
448452impl ToGraphicElement for ImageFrameTable < Color > { }
449- impl ToGraphicElement for TextureFrame { }
453+ impl ToGraphicElement for ImageTexture { }
450454
451455impl < T > From < T > for GraphicGroup
452456where
0 commit comments