Fixing bug with changing text size #3159

Bug appeared after 046940f but it was there before - it was just kind of compensated by the other bug.
Because of that bug blender text size value was reupdated before saving it to pset therefore pset never received a new value.

Also added some refactor, planned to write some test to get this error covered.
This commit is contained in:
Andrej730
2023-05-16 17:05:12 +05:00
parent 87dba7c066
commit ae0ae76ee6
5 changed files with 20 additions and 16 deletions
+12 -1
View File
@@ -599,9 +599,16 @@ class TestShowDecorations(NewFile):
class TestUpdateTextValue(NewFile):
def test_updating_arbitrary_strings(self):
TestGetTextLiteral().test_run()
ifc = tool.Ifc.get()
obj = bpy.data.objects.get("Object")
subject.update_text_value(obj)
assert obj.BIMTextProperties.literals[0].value == "Literal"
literal = obj.BIMTextProperties.literals[0]
assert obj.BIMTextProperties.font_size == "2.5"
assert literal.value == "Literal"
assert literal.box_alignment[:] == tuple([False] * 6 + [True] + [False] * 2)
assert literal.ifc_definition_id == ifc.by_type("IfcTextLiteralWithExtent")[0].id()
def test_using_attribute_variables(self):
TestGetTextLiteral().test_run()
@@ -632,3 +639,7 @@ class TestUpdateTextValue(NewFile):
subject.update_text_value(obj)
assert obj.BIMTextProperties.literals[0].value == "Foo Baz Bar"
# TODO: implement
def test_update_text_font_size(self):
pass