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

how to resize in horizontal and vertical axis? #656

Open
bboyle opened this issue Oct 18, 2024 · 4 comments
Open

how to resize in horizontal and vertical axis? #656

bboyle opened this issue Oct 18, 2024 · 4 comments

Comments

@bboyle
Copy link

bboyle commented Oct 18, 2024

image

Screenshot above from the demo site: https://stackblitz.com/edit/image-cropper?file=src%2Fmain.ts

The cropper has 8 handles (squares) for resizing.
The 4 corners work by resizing diagonally, as I would expect.
The 4 middle handles I would expect to size on that center axis.

I drag the top-middle handle downwards, I would expect the cropped area to shrink by moving the top border down and the left and right sides in by equal amounts. Instead, the top-middle handle behaves exactly the same as the top-right handle.

Is there a setting to change this behaviour, or is it a bug? need a PR? thoughts?

ps: this aside, it's a great component! thanks for publishing it :)

@bboyle
Copy link
Author

bboyle commented Oct 19, 2024

thought on this a little more. basically I expect the transform origin to be the opposite handle when dragging. so if you drag a corner, the origin is the diagonally opposite corner. if you drag the top-middle handle, the origin would be the bottom middle handle (again, directly opposite). Will look at a PR early next week

@loiddy
Copy link
Contributor

loiddy commented Oct 21, 2024

Hiya,

I've already done this: #644. If you want to try it and give us feedback that would be awesome.

I'm working through other changes and the idea is to merge everything together. Will take a while.

@bboyle
Copy link
Author

bboyle commented Oct 21, 2024

That sounds cool :) The images on that PR look great, that resize behaviour is indeed what I am looking for!
My feedback would be to split it into smaller pull-requests so features can be released quicker — obviously I have a vested interest. I'll give feedback on the PR

@bboyle
Copy link
Author

bboyle commented Oct 21, 2024

ps: thanks so much for tackling the resize behaviour, that's awesome :)

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

No branches or pull requests

2 participants