Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNGs get now moved by rotation center, some remove of dead code, SVG … #80

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

AntiDog
Copy link
Contributor

@AntiDog AntiDog commented Jun 18, 2018

…Texts are now onscreen

@AntiDog AntiDog requested a review from Hyderow June 18, 2018 16:17
Copy link
Contributor Author

@AntiDog AntiDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some stuff to make clear what I have changed and make the review easier

@@ -1089,7 +1089,7 @@ def _add_default_behaviour_to(sprite, sprite_context, catrobat_scene, catrobat_p

object_relative_scale = scratch_object.get_scale() or 1
if costume_resolution is not None:
object_scale = object_relative_scale * 100.0 / costume_resolution
object_scale = object_relative_scale * 100.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was responsible for wrong object scaling/ that we "sometimes" had wrong scaling with the set size to 50% block at start (and sometimes not)

@@ -146,8 +147,7 @@ def convert(self, progress_bar = None):
#TODO: background gets scaled too, shouldn't be the case
if ispng:
isStageCostume = scratch_object.name == "Stage"
if not isStageCostume and JsonKeys.COSTUME_RESOLUTION in costume_info:
self.resize_png(costume_src_path, costume_src_path, costume_info[JsonKeys.COSTUME_RESOLUTION])
self.convertPNG(isStageCostume, costume_info,costume_src_path, costume_src_path)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some refactoring - nothing fancy

del root.attrib['viewBox']

for child in root:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only iterated over elements directly in root, now we iterate over all

also i removed the del root.attrib['viewBox'] because I don't think this is needed

if re.search('.*}text', child.tag) != None:
child.attrib['x'] = '3'
child.attrib['y'] = '22'
child.attrib['y'] = '23'
Copy link
Contributor Author

@AntiDog AntiDog Jun 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK where these numbers come from but they seem to work, without them the text isn't in the right place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with 23 we fix a minor cut off on top of the text (its now more centered)

@Hyderow Hyderow merged commit cb955f8 into Catrobat:develop Jun 19, 2018
@AntiDog AntiDog mentioned this pull request Feb 25, 2019
AntiDog added a commit that referenced this pull request Feb 25, 2019
Scratch 3.0 Integration

Since Scratch 2.0 the converter is no longer working. With these changes the converter should be working again.

Changes:

Scratch 3.0 Integration, Bug fixes, Media converter fixes:

[STCC-123] - Fix key sprites not being added correctly (#59)
STCC-128 Deleted Uservariables are now created by the converter (#62)
STCC-129 Conversion now allows floats as hight&width errormessage fixes (#64)
STCC-122 blocks setting missing looks are now replaced by notebricks (#65)
[STCC-121] - Fix conversion of PointToBrick (#60)
STCC-120: Update Class Hierarchy Excerpt (#67)
TESTFIX: Change spinnerSelection values in tests (#68)
STCC-141 Broadcast message can be a number which causes an exception
Merge pull request #73 from AntiDog/STCC-141
STCC-144 Fixed only keys of one sprite being added. (#75)
STCC-136 PNG files now get scaled (#74)
STCC-143 Unknown fonts get replaced, fonts now get scaled (#76)
STCC-145 Support mouse cursor for distanceTo block (#77)
PNGs get now moved by rotation center, some remove of dead code, SVG Texts now onscreen (#80)
new class hierachy excerpt and empty images no longer crash catroid (1px gets set) (#81)
STCC-151 Implement parser for Scratch3 files (#82)
STCC-148 Rework pseudo mouse (#79)
STCC-114 Any key is now recognized in keypressed blocks and scripts (#78)
STCC-146 Execute keyPressed scripts repeatedly if key is held down (#83)
STCC-164 Basic unittests for Scratch3 look blocks (#84)
STCC-174 Insert correct default values for user blocks (#87)
STCC-170 Refactor methods in Scratch3 parser to be more readable (#85)
Use alternative scratch3 sprite attribute to read look filenames (#89)
STCC-173 Add more logging to Scratch3 parser (#86)
STCC-172 tspans in svg cause errors (#88)
dbg (#91) - (Debug.py for debugging purposes)
[STCC-169] basic sound block testcases (#90)
[STCC-168] Add unit tests for sensor blocks (#92)
[STCC-162] Basic testcases for data blocks (#93)
[STCC-163] Add tests for control blocks (#94)
[STCC-165] Add motion block testcases (#95)
[STCC-166] Add unit tests for operator blocks (#96)
[STCC-178] - Integrate Scratch3 into converter (#97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants