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

Feature request: Align to Center #403

Closed
fernandodiacenco opened this issue Feb 9, 2016 · 5 comments
Closed

Feature request: Align to Center #403

fernandodiacenco opened this issue Feb 9, 2016 · 5 comments
Labels
Milestone

Comments

@fernandodiacenco
Copy link

Hi,

I would like to suggest the possibility of aligning the object on the center of the screen

Currently I have to export my files as png, open up on gimp and do some witchcraft to align to center, and for some reason that leaves the files slightly larger than the original Piskel ones

Thanks for the hard work!

@juliandescottes
Copy link
Collaborator

Thanks for opening this!

Some questions :

  • What do you mean by "object"?
  • Can you post some screenshots of a before/after to help me understand what we are after here ?

Thanks!

@fernandodiacenco
Copy link
Author

Oh thanks for answering!

I imagined something like this:

I make little thing

01

I select it with rectangle selection or something

02

I press Piskel Super Magic Button™ to align the selected "object" to the center of the.. canvas or whatever its called

03

Ta da!

@juliandescottes
Copy link
Collaborator

Thanks for detailed info, definitely helps.

So that could be :

  • if the user has a selection, move the selection to the center of the canvas
  • if there is no selection, we could still detect the smaller non-transparent rectangle (ie. what you selected in your screenshot) and move that

I think that fits with the other "transform" tools on the right side. But that's a bit more advanced/edge-case than the current ones (rotate, flip and clone). Maybe we should introduce a kind of menu or configuration in order to access this kind of more advanced features.

@juliandescottes
Copy link
Collaborator

If anyone wants to pick this up, feel free to add it to the "transform" tools box.
Additional requirement on top of my previous comment:

  • it should support CTRL/SHIFT to apply to all layers/frames, same as the Rotate and Mirror tool
  • it should support undo/redo (ie send SAVE_STATE event, and provide a replay function)
  • it should have an icon

The code for the transform tools is in src/js/tools/transform.
Look at the pskl.tools.ToolsHelper.getTargetFrames to implement the CTRL/SHIFT modifiers.
Here I would advise not to reuse the AbstractTransformTool, which I will probably remove soon. But you can have a look at the implementation to see how state save&replay is handled.

mattdinthehouse added a commit to mattdinthehouse/piskel that referenced this issue May 10, 2016
juliandescottes added a commit that referenced this issue May 12, 2016
@juliandescottes
Copy link
Collaborator

Feature added by @mattdinthehouse
Closing the issue. Will be released in v0.8.0

@juliandescottes juliandescottes added this to the v0.8 milestone Jul 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants