From 846db3276821ae995c913ad3f40dbfbadd008450 Mon Sep 17 00:00:00 2001 From: mwechsler Date: Mon, 7 Jun 2021 17:21:21 +0200 Subject: [PATCH 1/2] [STCC 307] Standard setRotationStyle wrong conversion --- src/scratchtocatrobat/converter/converter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scratchtocatrobat/converter/converter.py b/src/scratchtocatrobat/converter/converter.py index 512077f8..f4528f0a 100644 --- a/src/scratchtocatrobat/converter/converter.py +++ b/src/scratchtocatrobat/converter/converter.py @@ -2025,12 +2025,12 @@ def _add_default_behaviour_to(sprite, sprite_context, catrobat_scene, catrobat_p rotation_style = scratch_object.get_rotationStyle() if rotation_style is not None: traverser = _BlocksConversionTraverser(sprite, catrobat_project) - if rotation_style == "leftRight": - set_rotation_style_brick = traverser._converted_helper_brick_or_formula_element(["left-right"], "setRotationStyle") + if rotation_style == "left-right": + set_rotation_style_brick = traverser._converted_helper_brick_or_formula_element([rotation_style], "setRotationStyle") assert set_rotation_style_brick is not None implicit_bricks_to_add += [set_rotation_style_brick] - elif rotation_style == "none": - set_rotation_style_brick = traverser._converted_helper_brick_or_formula_element(["don't rotate"], "setRotationStyle") + elif rotation_style == "don't rotate": + set_rotation_style_brick = traverser._converted_helper_brick_or_formula_element([rotation_style], "setRotationStyle") assert set_rotation_style_brick is not None implicit_bricks_to_add += [set_rotation_style_brick] From 6eba7b2d3602194bbfecd39e0df75fde9c6bfc88 Mon Sep 17 00:00:00 2001 From: tobi Date: Mon, 18 Oct 2021 11:48:10 +0200 Subject: [PATCH 2/2] Added missing rotation style --- src/scratchtocatrobat/converter/converter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scratchtocatrobat/converter/converter.py b/src/scratchtocatrobat/converter/converter.py index f4528f0a..9b953a64 100644 --- a/src/scratchtocatrobat/converter/converter.py +++ b/src/scratchtocatrobat/converter/converter.py @@ -2033,6 +2033,10 @@ def _add_default_behaviour_to(sprite, sprite_context, catrobat_scene, catrobat_p set_rotation_style_brick = traverser._converted_helper_brick_or_formula_element([rotation_style], "setRotationStyle") assert set_rotation_style_brick is not None implicit_bricks_to_add += [set_rotation_style_brick] + elif rotation_style == "all around": + set_rotation_style_brick = traverser._converted_helper_brick_or_formula_element([rotation_style], "setRotationStyle") + assert set_rotation_style_brick is not None + implicit_bricks_to_add += [set_rotation_style_brick] # initialization of object's variables for scratch_variable in scratch_object.get_variables():