mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
parent
203be63374
commit
aa902efb56
4 changed files with 0 additions and 25 deletions
|
@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,18 +79,6 @@ fn boolean_operation_node(graphic_group: GraphicGroup, boolean_operation: Boolea
|
|||
boolean_operation_on_vector_data(&vector_data, BooleanOperation::Union)
|
||||
}
|
||||
GraphicElement::ImageFrame(image) => vector_from_image(image),
|
||||
// Union all vector data in the artboard into a single vector
|
||||
GraphicElement::Artboard(artboard) => {
|
||||
let artboard_subpath = Subpath::new_rect(artboard.location.as_dvec2(), artboard.location.as_dvec2() + artboard.dimensions.as_dvec2());
|
||||
|
||||
let mut artboard_vector = VectorData::from_subpath(artboard_subpath);
|
||||
artboard_vector.style.set_fill(graphene_core::vector::style::Fill::Solid(artboard.background));
|
||||
|
||||
let mut vector_data = vec![artboard_vector];
|
||||
vector_data.extend(collect_vector_data(&artboard.graphic_group).into_iter());
|
||||
|
||||
boolean_operation_on_vector_data(&vector_data, BooleanOperation::Union)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue