Finish removing GraphicElement::Artboard started in #1824 (#1830)

This commit is contained in:
Keavon Chambers 2024-07-14 01:50:25 -07:00 committed by GitHub
parent 203be63374
commit aa902efb56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 25 deletions

View file

@ -67,8 +67,6 @@ pub enum GraphicElement {
VectorData(Box<VectorData>),
/// A 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
ImageFrame(ImageFrame<Color>),
/// The bounds for displaying a page of contained content
Artboard(Artboard),
}
// TODO: Can this be removed? It doesn't necessarily make that much sense to have a default when, instead, the entire GraphicElement just shouldn't exist if there's no specific content to assign it.
@ -355,8 +353,6 @@ impl GraphicElement {
}
usvg::Node::Group(Box::new(group_element))
}
// TODO
GraphicElement::Artboard(_board) => usvg::Node::Group(Box::default()),
}
}
}

View file

@ -559,7 +559,6 @@ impl GraphicElementRendered for GraphicElement {
GraphicElement::VectorData(vector_data) => vector_data.render_svg(render, render_params),
GraphicElement::ImageFrame(image_frame) => image_frame.render_svg(render, render_params),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.render_svg(render, render_params),
GraphicElement::Artboard(artboard) => artboard.render_svg(render, render_params),
}
}
@ -568,7 +567,6 @@ impl GraphicElementRendered for GraphicElement {
GraphicElement::VectorData(vector_data) => GraphicElementRendered::bounding_box(&**vector_data, transform),
GraphicElement::ImageFrame(image_frame) => image_frame.bounding_box(transform),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.bounding_box(transform),
GraphicElement::Artboard(artboard) => artboard.bounding_box(transform),
}
}
@ -577,7 +575,6 @@ impl GraphicElementRendered for GraphicElement {
GraphicElement::VectorData(vector_data) => vector_data.add_click_targets(click_targets),
GraphicElement::ImageFrame(image_frame) => image_frame.add_click_targets(click_targets),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.add_click_targets(click_targets),
GraphicElement::Artboard(artboard) => artboard.add_click_targets(click_targets),
}
}
@ -586,7 +583,6 @@ impl GraphicElementRendered for GraphicElement {
GraphicElement::VectorData(vector_data) => vector_data.to_usvg_node(),
GraphicElement::ImageFrame(image_frame) => image_frame.to_usvg_node(),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.to_usvg_node(),
GraphicElement::Artboard(artboard) => artboard.to_usvg_node(),
}
}
@ -595,7 +591,6 @@ impl GraphicElementRendered for GraphicElement {
GraphicElement::VectorData(vector_data) => vector_data.contains_artboard(),
GraphicElement::ImageFrame(image_frame) => image_frame.contains_artboard(),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.contains_artboard(),
GraphicElement::Artboard(artboard) => artboard.contains_artboard(),
}
}
}

View file

@ -76,7 +76,6 @@ impl Transform for GraphicElement {
GraphicElement::VectorData(vector_shape) => vector_shape.transform(),
GraphicElement::ImageFrame(image_frame) => image_frame.transform(),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.transform(),
GraphicElement::Artboard(artboard) => artboard.transform(),
}
}
fn local_pivot(&self, pivot: DVec2) -> DVec2 {
@ -84,7 +83,6 @@ impl Transform for GraphicElement {
GraphicElement::VectorData(vector_shape) => vector_shape.local_pivot(pivot),
GraphicElement::ImageFrame(image_frame) => image_frame.local_pivot(pivot),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.local_pivot(pivot),
GraphicElement::Artboard(artboard) => artboard.local_pivot(pivot),
}
}
fn decompose_scale(&self) -> DVec2 {
@ -92,7 +90,6 @@ impl Transform for GraphicElement {
GraphicElement::VectorData(vector_shape) => vector_shape.decompose_scale(),
GraphicElement::ImageFrame(image_frame) => image_frame.decompose_scale(),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.decompose_scale(),
GraphicElement::Artboard(artboard) => artboard.decompose_scale(),
}
}
}
@ -102,7 +99,6 @@ impl TransformMut for GraphicElement {
GraphicElement::VectorData(vector_shape) => vector_shape.transform_mut(),
GraphicElement::ImageFrame(image_frame) => image_frame.transform_mut(),
GraphicElement::GraphicGroup(graphic_group) => graphic_group.transform_mut(),
GraphicElement::Artboard(_) => todo!("Transform of artboard"),
}
}
}