From f763e4b0a761a2ecc80c3fa89ba914c4bc3dcb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Tue, 15 Oct 2024 10:00:39 -0300 Subject: [PATCH] Remove increment snap from the measure tool. --- src/bonsai/bonsai/bim/module/model/polyline.py | 8 ++++---- src/bonsai/bonsai/bim/module/model/wall.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/polyline.py b/src/bonsai/bonsai/bim/module/model/polyline.py index 75226bc1a8..1afc147564 100644 --- a/src/bonsai/bonsai/bim/module/model/polyline.py +++ b/src/bonsai/bonsai/bim/module/model/polyline.py @@ -330,7 +330,7 @@ class PolylineOperator: tool.Blender.update_viewport() return {"CANCELLED"} - def handle_mouse_move(self, context, event): + def handle_mouse_move(self, context, event, should_round=False): if not self.tool_state.is_input_on: if event.type == "MOUSEMOVE" or event.type == "INBETWEEN_MOUSEMOVE": self.mousemove_count += 1 @@ -353,15 +353,15 @@ class PolylineOperator: detected_snaps = tool.Snap.detect_snapping_points(context, event, self.objs_2d_bbox, self.tool_state) self.snapping_points = tool.Snap.select_snapping_points(context, event, self.tool_state, detected_snaps) - should_round = False - if self.snapping_points[0][1] in {"Plane", "Axis"}: - should_round = True + if self.snapping_points[0][1] not in {"Plane", "Axis"}: + should_round=False tool.Polyline.calculate_distance_and_angle( context, self.input_ui, self.tool_state, should_round=should_round ) if should_round: tool.Polyline.calculate_x_y_and_z(context, self.input_ui, self.tool_state) + tool.Blender.update_viewport() return {"RUNNING_MODAL"} diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index b98480e14c..aefb3af676 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -332,7 +332,7 @@ class DrawPolylineWall(bpy.types.Operator, PolylineOperator): self.handle_instructions(context) - self.handle_mouse_move(context, event) + self.handle_mouse_move(context, event, should_round=True) self.choose_axis(event)