diff --git a/docs/design/notes/gui.md b/docs/design/notes/gui.md index dafcf97182..55d772d9b7 100644 --- a/docs/design/notes/gui.md +++ b/docs/design/notes/gui.md @@ -585,7 +585,6 @@ Plugin styles are blocking or ambient. And some can conflict... - probably dont need all those methods in UIState. just a way to get the main state. -- dont recreate PluginCtx so many times? changing plugin API or something should help. - probably change Plugin APIs... ambient_event and one event() indicating done or not. dont express blockingness in that API. - actually, take away Plugin trait entirely? Except for the stuff that gets all boxed up? diff --git a/editor/src/state.rs b/editor/src/state.rs index 60c96cb35e..35a090b80e 100644 --- a/editor/src/state.rs +++ b/editor/src/state.rs @@ -104,18 +104,18 @@ impl UIState for DefaultUIState { cs: &mut ColorScheme, canvas: &mut Canvas, ) { + let mut ctx = PluginCtx { + primary: &mut self.primary, + secondary: &mut self.secondary, + canvas, + cs, + input, + hints, + recalculate_current_selection, + }; + // Exclusive blocking plugins first { - let mut ctx = PluginCtx { - primary: &mut self.primary, - secondary: &mut self.secondary, - canvas, - cs, - input, - hints, - recalculate_current_selection, - }; - // Special cases of weird blocking exclusive plugins! if self .primary_plugins @@ -212,16 +212,6 @@ impl UIState for DefaultUIState { // Exclusive nonblocking plugins { - let mut ctx = PluginCtx { - primary: &mut self.primary, - secondary: &mut self.secondary, - canvas, - cs, - input, - hints, - recalculate_current_selection, - }; - if self.exclusive_nonblocking_plugin.is_some() { if !self .exclusive_nonblocking_plugin @@ -243,16 +233,6 @@ impl UIState for DefaultUIState { } // Stackable modal plugins - let mut ctx = PluginCtx { - primary: &mut self.primary, - secondary: &mut self.secondary, - canvas, - cs, - input, - hints, - recalculate_current_selection, - }; - if self.show_score.is_some() { if !self .show_score