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

Adds Autocrop feature #1574

Merged
merged 4 commits into from Jun 3, 2017

Conversation

Projects
None yet
3 participants
@ketanhwr
Contributor

ketanhwr commented May 21, 2017

This addresses #642. The option is available in the 'Map' menu and is available only when a Tile Layer is selected. The implementation is pretty straightforward:

  • First compute the (minX, minY) and (maxX, maxY) by checking all the cells of the current layer.
  • Resize the map using this region.
  • Works similar to Crop to Selection, except, the region is calculated using TileLayer::computeAutocropRegion()
@Ablu

added some comments for now

Show outdated Hide outdated src/libtiled/tilelayer.cpp
Show outdated Hide outdated src/tiled/mainwindow.cpp
Show outdated Hide outdated src/tiled/mapdocument.cpp
Show outdated Hide outdated src/tiled/mapdocument.cpp
Show outdated Hide outdated src/tiled/mapdocument.cpp
Show outdated Hide outdated src/tiled/mapdocument.cpp
Show outdated Hide outdated src/tiled/mapdocumentactionhandler.cpp
Show outdated Hide outdated src/tiled/mapdocumentactionhandler.cpp
Show outdated Hide outdated src/tiled/mapdocumentactionhandler.h
@bjorn

Apart from two small nitpicks about whitespace, this change is ready to go in.

I will wait with merging it until I have created the 1.0 branch, since due to the string freeze this feature will go to Tiled 1.1.

Thanks!

Show outdated Hide outdated src/tiled/mainwindow.cpp
Show outdated Hide outdated src/tiled/mapdocument.cpp
@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jun 3, 2017

Contributor

@bjorn I think you forgot this one 🙂

Contributor

ketanhwr commented Jun 3, 2017

@bjorn I think you forgot this one 🙂

@bjorn bjorn merged commit ac307f1 into bjorn:master Jun 3, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jun 3, 2017

Owner

@ketanhwr Indeed, I haven't created an 1.0 branch yet, but I implicitly ended the string freeze by merging #1580, so this one can go in now as well. Thanks for the reminder! :-)

Owner

bjorn commented Jun 3, 2017

@ketanhwr Indeed, I haven't created an 1.0 branch yet, but I implicitly ended the string freeze by merging #1580, so this one can go in now as well. Thanks for the reminder! :-)

thabetx added a commit to thabetx/tiled that referenced this pull request Jun 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment