mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 20:38:12 +08:00
De duplicate Overlay render messages (#520)
This commit is contained in:
committed by
Keavon Chambers
parent
386c970b60
commit
5ea4654f53
@@ -30,6 +30,7 @@ struct DispatcherMessageHandlers {
|
|||||||
// In addition, these messages do not change any state in the backend (aside from caches).
|
// In addition, these messages do not change any state in the backend (aside from caches).
|
||||||
const SIDE_EFFECT_FREE_MESSAGES: &[MessageDiscriminant] = &[
|
const SIDE_EFFECT_FREE_MESSAGES: &[MessageDiscriminant] = &[
|
||||||
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::RenderDocument)),
|
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::RenderDocument)),
|
||||||
|
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::Overlays(OverlaysMessageDiscriminant::Rerender))),
|
||||||
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::FolderChanged)),
|
MessageDiscriminant::Portfolio(PortfolioMessageDiscriminant::Document(DocumentMessageDiscriminant::FolderChanged)),
|
||||||
MessageDiscriminant::Frontend(FrontendMessageDiscriminant::UpdateDocumentLayer),
|
MessageDiscriminant::Frontend(FrontendMessageDiscriminant::UpdateDocumentLayer),
|
||||||
MessageDiscriminant::Frontend(FrontendMessageDiscriminant::DisplayDocumentLayerTreeStructure),
|
MessageDiscriminant::Frontend(FrontendMessageDiscriminant::DisplayDocumentLayerTreeStructure),
|
||||||
|
|||||||
@@ -18,26 +18,27 @@ impl MessageHandler<OverlaysMessage, bool> for OverlaysMessageHandler {
|
|||||||
// Sub-messages
|
// Sub-messages
|
||||||
#[remain::unsorted]
|
#[remain::unsorted]
|
||||||
DispatchOperation(operation) => match self.overlays_graphene_document.handle_operation(&operation) {
|
DispatchOperation(operation) => match self.overlays_graphene_document.handle_operation(&operation) {
|
||||||
Ok(_) => (),
|
Ok(_) => responses.push_back(OverlaysMessage::Rerender.into()),
|
||||||
Err(e) => log::error!("OverlaysError: {:?}", e),
|
Err(e) => log::error!("OverlaysError: {:?}", e),
|
||||||
},
|
},
|
||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
ClearAllOverlays => todo!(),
|
ClearAllOverlays => todo!(),
|
||||||
Rerender => (),
|
Rerender =>
|
||||||
}
|
// Render overlays
|
||||||
|
{
|
||||||
// Render overlays
|
responses.push_back(
|
||||||
responses.push_back(
|
FrontendMessage::UpdateDocumentOverlays {
|
||||||
FrontendMessage::UpdateDocumentOverlays {
|
svg: if overlays_visible {
|
||||||
svg: if overlays_visible {
|
self.overlays_graphene_document.render_root(ViewMode::Normal)
|
||||||
self.overlays_graphene_document.render_root(ViewMode::Normal)
|
} else {
|
||||||
} else {
|
String::from("")
|
||||||
String::from("")
|
},
|
||||||
},
|
}
|
||||||
|
.into(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
.into(),
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn actions(&self) -> ActionList {
|
fn actions(&self) -> ActionList {
|
||||||
|
|||||||
Reference in New Issue
Block a user