Skip to content

blocks2image: More reliable offset calculations - #7783

Merged
WorldLanguages merged 10 commits into
ScratchAddons:masterfrom
Samq64:START_HAT_HEIGHT
Dec 11, 2024
Merged

blocks2image: More reliable offset calculations#7783
WorldLanguages merged 10 commits into
ScratchAddons:masterfrom
Samq64:START_HAT_HEIGHT

Conversation

@Samq64

@Samq64 Samq64 commented Sep 5, 2024

Copy link
Copy Markdown
Member

Closes #7644

Changes

Use getBBox() to determine translateY when exporting blocks. Also adds the tiny bit of padding from #7644 so the block borders are never clipped.

Reason for changes

Better addon compatibility

Tests

Tested on Chromium with custom block colours, custom block shape and cat blocks.

Export all is the same as before and still needs work. Done!

Related: #5604 (comment)

@Samq64 Samq64 added the scope: addon Related to one or multiple addons label Sep 5, 2024
@Samq64 Samq64 changed the title blocks2image: Fix cropping when exporting a single stack blocks2image: Don't rely on magic numbers when exporting a single stack Sep 5, 2024
@Samq64 Samq64 changed the title blocks2image: Don't rely on magic numbers when exporting a single stack blocks2image: Remove block type check Sep 5, 2024
@Samq64 Samq64 changed the title blocks2image: Remove block type check blocks2image: More reliable offset calculations Sep 8, 2024

@WorldLanguages WorldLanguages left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I did not test this

@Samq64
Samq64 requested a review from TheColaber September 13, 2024 12:54
@WorldLanguages

Copy link
Copy Markdown
Member

@Samq64 Take a second look at your changes, if you still agree with them and feel quite confident, we can merge this.

@Samq64

Samq64 commented Oct 3, 2024

Copy link
Copy Markdown
Member Author

The console complains about the iframe not having an src but that was not introduced here.

@Samq64 Samq64 added the status: needs review PR needs 1 more approval label Oct 3, 2024
@Samq64

Samq64 commented Oct 10, 2024

Copy link
Copy Markdown
Member Author

@TheColaber Could you please review this since you have a couple open PRs waiting for it?

@Samq64 Samq64 added this to the v1.40.0 milestone Oct 29, 2024
@Samq64 Samq64 mentioned this pull request Dec 9, 2024
@WorldLanguages
WorldLanguages merged commit 4e03104 into ScratchAddons:master Dec 11, 2024
@WorldLanguages WorldLanguages removed the status: needs review PR needs 1 more approval label Dec 11, 2024
@Samq64
Samq64 deleted the START_HAT_HEIGHT branch December 11, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: addon Related to one or multiple addons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants