Implement key handling (#65)

This commit is contained in:
TrueDoctor
2021-04-07 11:02:56 +02:00
committed by GitHub
parent 89ed123356
commit b7f18dfaa8
7 changed files with 112 additions and 13 deletions
+4
View File
@@ -77,6 +77,10 @@ impl ToolFsmState {
pub fn active_tool(&mut self) -> Result<&mut Box<dyn Tool>, EditorError> {
self.tools.get_mut(&self.active_tool_type).ok_or(EditorError::UnknownTool)
}
pub fn swap_colors(&mut self) {
std::mem::swap(&mut self.primary_color, &mut self.secondary_color);
}
}
fn default_tool_settings() -> HashMap<ToolType, ToolSettings> {