mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
Remove dead code from document-legacy
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
use crate::boolean_ops::BooleanOperation as BooleanOperationType;
|
||||
use crate::layers::blend_mode::BlendMode;
|
||||
use crate::layers::layer_info::Layer;
|
||||
use crate::layers::style::{self, Stroke};
|
||||
use crate::LayerId;
|
||||
|
||||
use graphene_core::vector::SelectedType;
|
||||
use graphene_std::vector::consts::ManipulatorType;
|
||||
use graphene_std::vector::manipulator_group::ManipulatorGroup;
|
||||
use graphene_std::vector::subpath::Subpath;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -18,24 +14,6 @@ use std::hash::{Hash, Hasher};
|
||||
// TODO: Rename all instances of `path` to `layer_path`
|
||||
/// Operations that can be performed to mutate the document.
|
||||
pub enum Operation {
|
||||
AddEllipse {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
},
|
||||
AddRect {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
},
|
||||
AddLine {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
},
|
||||
AddFrame {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
@@ -58,75 +36,12 @@ pub enum Operation {
|
||||
layer_path: Vec<LayerId>,
|
||||
pivot: (f64, f64),
|
||||
},
|
||||
AddPolyline {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
points: Vec<(f64, f64)>,
|
||||
},
|
||||
AddSpline {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
points: Vec<(f64, f64)>,
|
||||
},
|
||||
AddNgon {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
sides: u32,
|
||||
},
|
||||
AddShape {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
// TODO This will become a compound path once we support them.
|
||||
subpath: Subpath,
|
||||
},
|
||||
BooleanOperation {
|
||||
operation: BooleanOperationType,
|
||||
selected: Vec<Vec<LayerId>>,
|
||||
},
|
||||
DeleteLayer {
|
||||
path: Vec<LayerId>,
|
||||
},
|
||||
DeleteSelectedManipulatorPoints {
|
||||
layer_paths: Vec<Vec<LayerId>>,
|
||||
},
|
||||
DeselectManipulatorPoints {
|
||||
layer_path: Vec<LayerId>,
|
||||
point_ids: Vec<(u64, ManipulatorType)>,
|
||||
},
|
||||
DeselectAllManipulatorPoints {
|
||||
layer_path: Vec<LayerId>,
|
||||
},
|
||||
SelectAllAnchors {
|
||||
layer_path: Vec<LayerId>,
|
||||
},
|
||||
DuplicateLayer {
|
||||
path: Vec<LayerId>,
|
||||
},
|
||||
MoveSelectedManipulatorPoints {
|
||||
layer_path: Vec<LayerId>,
|
||||
delta: (f64, f64),
|
||||
mirror_distance: bool,
|
||||
},
|
||||
MoveManipulatorPoint {
|
||||
layer_path: Vec<LayerId>,
|
||||
id: u64,
|
||||
manipulator_type: SelectedType,
|
||||
position: (f64, f64),
|
||||
},
|
||||
SetManipulatorPoints {
|
||||
layer_path: Vec<LayerId>,
|
||||
id: u64,
|
||||
manipulator_type: ManipulatorType,
|
||||
position: Option<(f64, f64)>,
|
||||
},
|
||||
RenameLayer {
|
||||
layer_path: Vec<LayerId>,
|
||||
new_name: String,
|
||||
@@ -151,11 +66,6 @@ pub enum Operation {
|
||||
path: Vec<LayerId>,
|
||||
transform: [f64; 6],
|
||||
},
|
||||
SelectManipulatorPoints {
|
||||
layer_path: Vec<LayerId>,
|
||||
point_ids: Vec<(u64, ManipulatorType)>,
|
||||
add: bool,
|
||||
},
|
||||
SetShapePath {
|
||||
path: Vec<LayerId>,
|
||||
subpath: Subpath,
|
||||
@@ -164,28 +74,6 @@ pub enum Operation {
|
||||
path: Vec<LayerId>,
|
||||
vector_data: graphene_core::vector::VectorData,
|
||||
},
|
||||
InsertManipulatorGroup {
|
||||
layer_path: Vec<LayerId>,
|
||||
manipulator_group: ManipulatorGroup,
|
||||
after_id: u64,
|
||||
},
|
||||
PushManipulatorGroup {
|
||||
layer_path: Vec<LayerId>,
|
||||
manipulator_group: ManipulatorGroup,
|
||||
},
|
||||
PushFrontManipulatorGroup {
|
||||
layer_path: Vec<LayerId>,
|
||||
manipulator_group: ManipulatorGroup,
|
||||
},
|
||||
RemoveManipulatorGroup {
|
||||
layer_path: Vec<LayerId>,
|
||||
id: u64,
|
||||
},
|
||||
RemoveManipulatorPoint {
|
||||
layer_path: Vec<LayerId>,
|
||||
id: u64,
|
||||
manipulator_type: ManipulatorType,
|
||||
},
|
||||
TransformLayerInScope {
|
||||
path: Vec<LayerId>,
|
||||
transform: [f64; 6],
|
||||
@@ -196,10 +84,6 @@ pub enum Operation {
|
||||
transform: [f64; 6],
|
||||
scope: [f64; 6],
|
||||
},
|
||||
TransformLayerScaleAroundPivot {
|
||||
path: Vec<LayerId>,
|
||||
scale_factor: (f64, f64),
|
||||
},
|
||||
SetLayerScaleAroundPivot {
|
||||
path: Vec<LayerId>,
|
||||
new_scale: (f64, f64),
|
||||
@@ -208,9 +92,6 @@ pub enum Operation {
|
||||
path: Vec<LayerId>,
|
||||
transform: [f64; 6],
|
||||
},
|
||||
ToggleLayerVisibility {
|
||||
path: Vec<LayerId>,
|
||||
},
|
||||
SetLayerVisibility {
|
||||
path: Vec<LayerId>,
|
||||
visible: bool,
|
||||
@@ -231,10 +112,6 @@ pub enum Operation {
|
||||
path: Vec<LayerId>,
|
||||
opacity: f64,
|
||||
},
|
||||
SetLayerStyle {
|
||||
path: Vec<LayerId>,
|
||||
style: style::PathStyle,
|
||||
},
|
||||
SetLayerFill {
|
||||
path: Vec<LayerId>,
|
||||
fill: style::Fill,
|
||||
@@ -243,14 +120,43 @@ pub enum Operation {
|
||||
path: Vec<LayerId>,
|
||||
stroke: Stroke,
|
||||
},
|
||||
SetManipulatorHandleMirroring {
|
||||
layer_path: Vec<LayerId>,
|
||||
id: u64,
|
||||
mirror_angle: bool,
|
||||
|
||||
// The following are used only by the legacy overlays system
|
||||
AddEllipse {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
},
|
||||
SetSelectedHandleMirroring {
|
||||
layer_path: Vec<LayerId>,
|
||||
toggle_angle: bool,
|
||||
AddRect {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
},
|
||||
AddLine {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
},
|
||||
AddPolyline {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
points: Vec<(f64, f64)>,
|
||||
},
|
||||
AddShape {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
style: style::PathStyle,
|
||||
subpath: Subpath,
|
||||
},
|
||||
SetLayerStyle {
|
||||
path: Vec<LayerId>,
|
||||
style: style::PathStyle,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user