Skip to content

Commit 63d01fc

Browse files
committed
fix redraw issues
1 parent 3578ac5 commit 63d01fc

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

editor/src/messages/tool/tool_messages/select_tool.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ pub enum DotType {
9090
// Active,
9191
}
9292

93+
impl DotType {
94+
pub fn is_pivot(self) -> bool {
95+
self == Self::Pivot
96+
}
97+
}
98+
9399
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash, serde::Serialize, serde::Deserialize, specta::Type)]
94100
pub struct DotState {
95101
enabled: bool,
@@ -105,9 +111,9 @@ impl Default for DotState {
105111
}
106112
}
107113

108-
impl DotType {
109-
pub fn is_pivot(self) -> bool {
110-
self == Self::Pivot
114+
impl DotState {
115+
pub fn is_pivot(&self) -> bool {
116+
self.dot == DotType::Pivot || !self.enabled
111117
}
112118
}
113119

@@ -356,12 +362,14 @@ impl<'a> MessageHandler<ToolMessage, &mut ToolActionHandlerData<'a>> for SelectT
356362
responses.add(ToolMessage::UpdateHints);
357363
let dot = self.tool_data.get_as_dot();
358364
responses.add(TransformLayerMessage::SetDot { dot });
365+
responses.add(NodeGraphMessage::RunDocumentGraph);
359366
redraw_ref_pivot = true;
360367
}
361368
}
362369
SelectOptionsUpdate::ToggleDotType(state) => {
363370
self.tool_data.dot_state.enabled = *state;
364371
responses.add(ToolMessage::UpdateHints);
372+
responses.add(NodeGraphMessage::RunDocumentGraph);
365373
redraw_ref_pivot = true;
366374
}
367375
}
@@ -840,7 +848,7 @@ impl Fsm for SelectToolFsmState {
840848
.flatten()
841849
});
842850

843-
if overlay_context.visibility_settings.origin() && !tool_data.dot_state.dot.is_pivot() {
851+
if overlay_context.visibility_settings.origin() && !tool_data.dot_state.is_pivot() {
844852
for layer in document.network_interface.selected_nodes().selected_visible_and_unlocked_layers(&document.network_interface) {
845853
let origin = graph_modification_utils::get_viewport_origin(layer, &document.network_interface);
846854
overlay_context.dowel_pin(origin);

0 commit comments

Comments
 (0)