mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 09:18:11 +08:00
@@ -19,6 +19,7 @@ pub enum ArtboardMessage {
|
||||
position: (f64, f64),
|
||||
size: (f64, f64),
|
||||
},
|
||||
ClearArtboards,
|
||||
DeleteArtboard {
|
||||
artboard: LayerId,
|
||||
},
|
||||
|
||||
@@ -63,6 +63,11 @@ impl MessageHandler<ArtboardMessage, &FontCache> for ArtboardMessageHandler {
|
||||
|
||||
responses.push_back(DocumentMessage::RenderDocument.into());
|
||||
}
|
||||
ClearArtboards => {
|
||||
for &artboard in self.artboard_ids.iter() {
|
||||
responses.push_front(ArtboardMessage::DeleteArtboard { artboard }.into());
|
||||
}
|
||||
}
|
||||
DeleteArtboard { artboard } => {
|
||||
self.artboard_ids.retain(|&id| id != artboard);
|
||||
|
||||
|
||||
@@ -169,6 +169,8 @@ pub enum DocumentMessage {
|
||||
layer_path: Vec<LayerId>,
|
||||
layer_metadata: LayerMetadata,
|
||||
},
|
||||
ZoomCanvasTo100Percent,
|
||||
ZoomCanvasTo200Percent,
|
||||
ZoomCanvasToFitAll,
|
||||
}
|
||||
|
||||
|
||||
@@ -758,6 +758,12 @@ impl MessageHandler<DocumentMessage, (&InputPreprocessorMessageHandler, &FontCac
|
||||
UpdateLayerMetadata { layer_path, layer_metadata } => {
|
||||
self.layer_metadata.insert(layer_path, layer_metadata);
|
||||
}
|
||||
ZoomCanvasTo100Percent => {
|
||||
responses.push_front(MovementMessage::SetCanvasZoom { zoom_factor: 1. }.into());
|
||||
}
|
||||
ZoomCanvasTo200Percent => {
|
||||
responses.push_front(MovementMessage::SetCanvasZoom { zoom_factor: 2. }.into());
|
||||
}
|
||||
ZoomCanvasToFitAll => {
|
||||
if let Some(bounds) = self.document_bounds(font_cache) {
|
||||
responses.push_back(
|
||||
@@ -785,6 +791,8 @@ impl MessageHandler<DocumentMessage, (&InputPreprocessorMessageHandler, &FontCac
|
||||
SetSnapping,
|
||||
DebugPrintDocument,
|
||||
ZoomCanvasToFitAll,
|
||||
ZoomCanvasTo100Percent,
|
||||
ZoomCanvasTo200Percent,
|
||||
CreateEmptyFolder,
|
||||
);
|
||||
|
||||
|
||||
@@ -267,7 +267,6 @@ impl MessageHandler<MovementMessage, (&Document, &InputPreprocessorMessageHandle
|
||||
TranslateCanvasBegin,
|
||||
RotateCanvasBegin,
|
||||
ZoomCanvasBegin,
|
||||
SetCanvasZoom,
|
||||
SetCanvasRotation,
|
||||
WheelCanvasZoom,
|
||||
IncreaseCanvasZoom,
|
||||
|
||||
Reference in New Issue
Block a user