mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 15:28:04 +08:00
Polishing: standardize binding JS resize event (fixes non-integer AA rendering); remove "X" to delete; cleanup
This commit is contained in:
@@ -25,9 +25,9 @@ struct DispatcherMessageHandlers {
|
||||
tool_message_handler: ToolMessageHandler,
|
||||
}
|
||||
|
||||
// For optimization, these are messages guaranteed to be redundant when repeated.
|
||||
// The last occurrence of the message in the message queue is sufficient to ensure correct behavior.
|
||||
// In addition, these messages do not change any state in the backend (aside from caches).
|
||||
/// For optimization, these are messages guaranteed to be redundant when repeated.
|
||||
/// The last occurrence of the message in the message queue is sufficient to ensure correct behavior.
|
||||
/// In addition, these messages do not change any state in the backend (aside from caches).
|
||||
const SIDE_EFFECT_FREE_MESSAGES: &[MessageDiscriminant] = &[
|
||||
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::RenderDocument)),
|
||||
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::Overlays(OverlaysMessageDiscriminant::Rerender))),
|
||||
|
||||
@@ -29,6 +29,7 @@ pub enum FrontendMessage {
|
||||
TriggerIndexedDbRemoveDocument { document_id: u64 },
|
||||
TriggerIndexedDbWriteDocument { document: String, details: FrontendDocumentDetails, version: String },
|
||||
TriggerTextCommit,
|
||||
TriggerViewportResize,
|
||||
|
||||
// Update prefix: give the frontend a new value or state for it to use
|
||||
UpdateActiveDocument { document_id: u64 },
|
||||
|
||||
@@ -23,7 +23,7 @@ impl Default for Mapping {
|
||||
use Key::*;
|
||||
|
||||
// WARNING!
|
||||
// If a new mapping isn't being handled (and perhaps another lower-precedence one is instead), make sure to advertise
|
||||
// If a new mapping you added here isn't working (and perhaps another lower-precedence one is instead), make sure to advertise
|
||||
// it as an available action in the respective message handler file (such as the bottom of `document_message_handler.rs`).
|
||||
|
||||
let mappings = mapping![
|
||||
@@ -145,7 +145,6 @@ impl Default for Mapping {
|
||||
entry! {action=DocumentMessage::SelectAllLayers, key_down=KeyA, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::CreateEmptyFolder { container_path: vec![] }, key_down=KeyN, modifiers=[KeyControl, KeyShift]},
|
||||
entry! {action=DocumentMessage::DeleteSelectedLayers, key_down=KeyDelete},
|
||||
entry! {action=DocumentMessage::DeleteSelectedLayers, key_down=KeyX},
|
||||
entry! {action=DocumentMessage::DeleteSelectedLayers, key_down=KeyBackspace},
|
||||
entry! {action=DocumentMessage::ExportDocument, key_down=KeyE, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::SaveDocument, key_down=KeyS, modifiers=[KeyControl]},
|
||||
|
||||
@@ -47,6 +47,7 @@ impl MessageHandler<InputPreprocessorMessage, ()> for InputPreprocessorMessageHa
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
responses.push_back(FrontendMessage::TriggerViewportResize.into());
|
||||
}
|
||||
}
|
||||
InputPreprocessorMessage::DoubleClick { editor_mouse_state, modifier_keys } => {
|
||||
|
||||
@@ -10,9 +10,9 @@ use crate::viewport_tools::snapping::SnapHandler;
|
||||
use crate::viewport_tools::tool::{DocumentToolData, Fsm, ToolActionHandlerData};
|
||||
use crate::viewport_tools::vector_editor::shape_editor::ShapeEditor;
|
||||
|
||||
use glam::DVec2;
|
||||
use graphene::intersection::Quad;
|
||||
|
||||
use glam::DVec2;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
Reference in New Issue
Block a user