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

Add autocrop #642

Closed
alphaonex86 opened this issue Apr 16, 2014 · 5 comments
Closed

Add autocrop #642

alphaonex86 opened this issue Apr 16, 2014 · 5 comments
Labels
feature It's a feature, not a bug.

Comments

@alphaonex86
Copy link
Contributor

Hello,
As gimp, can you add auto crop to crop the empty (no object, no tile, no image, ...) and useless border.
It's more fast to map than select only the util zone and crop the selected zone.
Cheers,

@bjorn
Copy link
Member

bjorn commented Apr 16, 2014

While this sounds useful, I would personally prefer to implement "auto-growing" functionality instead. But of course auto-crop would be much easier to implement and something I may even have time for eventually.

@bjorn bjorn added the Feature label Apr 16, 2014
@bjorn bjorn changed the title [Features] Add autocrop Add autocrop Apr 16, 2014
@ketanhwr
Copy link
Contributor

The simple solution would be to resize the map based on (minX,minY) to (maxX,maxY), right? (Where min and max would be based on extreme coordinates of any placed tile.)

Altough I'm a bit confused as in how this would work when we're using multiple layers.

@bjorn
Copy link
Member

bjorn commented May 17, 2017

Although I'm a bit confused as in how this would work when we're using multiple layers.

You could just go through all layers and compute min/max based on that, but that won't work very nicely when in the future we decouple layer size and tile size from the map.

But, I just checked what GIMP does and actually it crops the image only based on the currently selected layer. So, surely that is acceptable behavior as well.

Then, the only remaining question is how to treat object layers. We could either just not support this option for now, or determine the boundaries of the objects on the current object layer and then somehow mapping that also to any potential tile layers. I think at first we could just disable this action when an object layer is selected.

@ketanhwr
Copy link
Contributor

Yes, alright. So I'll add an Autocrop option in the same menu where the resize menu is placed. What should be the suitable shortcut key for this, if needed?

@bjorn
Copy link
Member

bjorn commented May 18, 2017

What should be the suitable shortcut key for this, if needed?

I think it is a quite specific and rare action, so no shortcut is needed. GIMP also doesn't have a shortcut for it.

@bjorn bjorn closed this as completed in ac307f1 Jun 3, 2017
thabetx pushed a commit to thabetx/tiled that referenced this issue Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants