mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 17:58:11 +08:00
Refactor GRS messages and fix regression in chained GRS operations (#2450)
* Refactor GRS messages and have a switch handler * some cleanup * rename variables * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
b4006479d1
commit
7e7e88f6fa
@@ -299,6 +299,22 @@ pub enum TransformOperation {
|
||||
Scaling(Scale),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Copy, serde::Serialize, serde::Deserialize)]
|
||||
pub enum TransformType {
|
||||
Grab,
|
||||
Rotate,
|
||||
Scale,
|
||||
}
|
||||
|
||||
impl TransformType {
|
||||
pub fn equivalent_to(&self, operation: TransformOperation) -> bool {
|
||||
matches!(
|
||||
(operation, self),
|
||||
(TransformOperation::Scaling(_), TransformType::Scale) | (TransformOperation::Grabbing(_), TransformType::Grab) | (TransformOperation::Rotating(_), TransformType::Rotate)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl TransformOperation {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn apply_transform_operation(&self, selected: &mut Selected, increment_mode: bool, local: bool, quad: Quad, transform: DAffine2, pivot: DVec2, local_transform: DAffine2) {
|
||||
|
||||
Reference in New Issue
Block a user