Simplify add reference image size implementation and fix segfaulting tests

Previously, there was a dance between invoke, execute, and draw. This
can probably be resolved, but is a high-risk for undo bugs. This
simplifies the logic flow to just a traditional _invoke -> _execute.

I add a new feature test to at least make sure it does something, and
this also fixes the segfault in tool tests as it no longer requires the
launching of the file browser.
This commit is contained in:
Dion Moult
2026-02-17 18:11:13 +11:00
parent c6b14d1474
commit fcc80ad14a
3 changed files with 23 additions and 93 deletions
+1 -1
View File
@@ -938,7 +938,7 @@ class TestAddReferenceImage(NewFile):
obj = bpy.data.objects["IfcAnnotation/image"]
assert obj is not None
assert tool.Cad.are_vectors_equal(obj.dimensions, Vector((3.53982, 2.0, 0.0)))
assert tool.Cad.are_vectors_equal(obj.dimensions, Vector((1.0, 0.565, 0.0)))
material = obj.active_material
assert material