mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Frontend fixed to render changes to working colors when changed from backend (#180)
* Backend and Frontend modification to show working color mods * Remove comments & change precedence for tool and doc actions * Add keybind for resetting work colors * Minor Frontend changes
This commit is contained in:
committed by
GitHub
parent
0e488d99ff
commit
e867f4d7fc
@@ -67,11 +67,25 @@ impl MessageHandler<ToolMessage, (&SvgDocument, &InputPreprocessor)> for ToolMes
|
||||
SwapColors => {
|
||||
let doc_data = &mut self.tool_state.document_tool_data;
|
||||
std::mem::swap(&mut doc_data.primary_color, &mut doc_data.secondary_color);
|
||||
responses.push_back(
|
||||
FrontendMessage::UpdateWorkingColors {
|
||||
primary: doc_data.primary_color,
|
||||
secondary: doc_data.secondary_color,
|
||||
}
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
ResetColors => {
|
||||
let doc_data = &mut self.tool_state.document_tool_data;
|
||||
doc_data.primary_color = Color::BLACK;
|
||||
doc_data.secondary_color = Color::WHITE;
|
||||
responses.push_back(
|
||||
FrontendMessage::UpdateWorkingColors {
|
||||
primary: doc_data.primary_color,
|
||||
secondary: doc_data.secondary_color,
|
||||
}
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
message => {
|
||||
let tool_type = match message {
|
||||
|
||||
Reference in New Issue
Block a user