-
Notifications
You must be signed in to change notification settings - Fork 32
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
ratioClip and ratioWrap #28
Comments
I made this changes in setRatioWH: function ({ width, height, maxWidth, maxHeight, left, top, right, bottom }) {
if (!this.ratioWrap) return { width, height, left, top, right, bottom }
// 有設定比例的話進行調整
const ratioPos = this.ratioPos({ width, height })
if (ratioPos.x) {
height = Math.min(width / this.ratioWrap, maxHeight)
width = (height === maxHeight) ? height * this.ratioWrap : width
} else {
width = Math.min(height * this.ratioWrap, maxWidth)
height = (width === maxWidth) ? width / this.ratioWrap : height
}
return { width, height, left, top, right, bottom }
}, in props: {
ratioWrap: {
type: Number,
default: NaN
},
} It almost solved my problem. I don’t understand how to make the clip-area accept the desired ratio from the start. It takes the required ratio at the first resize. But does not accept the new ratio when moving the clip-area. Also, after it has taken a new position, there are problems with moving and resizing. |
How can I trigger a zoom of clip-area? |
If clip-area's size is based on/bind to |
ratioWrap is computed and it doesn |
Need to install packages with yarn, because used yarn workspace for connection with vuejs-clipper package source. |
All my changes in package I create in separated commit: suenot/vuejs-clipper-demo@d5a42b6 |
upd. demo updated. fixed wrong path to demo img |
I've made a beta version at beta branch, this will be the next published version after I update documents and getting feedbacks from you. I add three new props <clipper-basic
:ratio="1/1"
:warpRatio="4/3"
/> Please look at demo (you might need to release old browser cache to see the new release immediately.) to see how these props work. I will update the document soon to give a more clear perspective of these props and how clipper-basic works. |
I'm steel trying to just trigger zoom to engage setRatioWH from method.js :) |
You can set |
I will try it now on my demo. |
suenot/vuejs-clipper-demo@5822257 |
Great! 👍 |
Version 1.0.1 published |
This wonderful plugin needs additional options for clipper-basic /
I have a situation when I need to have a clipper ratio and a clip-area should be different. To prevent the clip-area from going beyond the image
Now there is a prop ratio - which applies to both the clipper and the clip-area
I would like to be able to exhibit various ratio
For example ratioClip and ratioWrap
The text was updated successfully, but these errors were encountered: