developergovindgupta / move-rotate-resizer

MIT License
16 stars 4 forks source link

Drag Overflow #1

Open mdellanave opened 1 year ago

mdellanave commented 1 year ago

Hello @developergovindgupta, thank you for sharing this nice lib!

I have a question, do you think it's possible to constrain the drag movement in the div passed during initialization?

I need to avoid this kind of overflow in every direction image

developergovindgupta commented 1 year ago

added new property in move-rotate-resizer https://www.npmjs.com/package/move-rotate-resizer v 1.0.6

boundWithContainer:false, // if true then target element can not move outside the container element.

https://www.npmjs.com/package/move-rotate-resizer https://github.com/developergovindgupta/move-rotate-resizer https://developergovindgupta.github.io/move-rotate-resizer/ https://codesandbox.io/s/move-rotate-resizer-demo-2-3x33ys

[image: image.png]

On Wed, 19 Jul 2023 at 19:25, mdellanave @.***> wrote:

Hello, thank you for sharing this nice lib!

I have a question, do you think it's possible to constrain the drag movment in the div passed during initialization?

I need to avoid this kind of overflow in every direction [image: image] https://user-images.githubusercontent.com/19222174/254595519-1c6914ad-e20d-4a21-9c1f-6d597d0137ef.png

— Reply to this email directly, view it on GitHub https://github.com/developergovindgupta/move-rotate-resizer/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXYHBHLIYGBDVOAIVXKHT3XQ7RLNANCNFSM6AAAAAA2P67ESM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Sr. Javascript Developer Govind Prasad Gupta For Designhill (a platform owned by Reliable E Solutions Pvt Ltd) p: 7841849768, 9335057042 a: Designhill , B 106 , Sector 29, Near Signature Tower , Gurgaon Haryana 122001 w: www.designhill.com e: @. @.> Featured in: [image: http://www.huffingtonpost.com/casey-cavanagh/crowdsourcing-platforms-a_b_8314266.html?ir=India&adsSiteOverride=in]

http://thenextweb.com/insider/2016/01/08/7-must-know-content-marketing-trends-of-2016/

http://www.forbes.com/sites/amyguttman/2015/10/11/startups-why-giving-stuff-away-for-free-is-the-best-marketing-tool/

mdellanave commented 1 year ago

thank you so much @developergovindgupta!

Can I suggest you one more little change? If the option boundWithContainer can be an html element then you could do something like that

image

to use the bounds of a not direct parent element

I tell you this because I'm using this library to allow image overlay in google maps, and here the parent html element is not usefull for the purpose.

image

With the suggested changes, if I use this option

image

it works like a charm!

mdellanave commented 1 year ago

Another nice improvements could be the option to define the dom parent of the resizer-container (instead of the body element) to avoid overflow image

The red area should be hidden because of the container bounds

like this one where I manually moved the resizer-container in the map container div

image
developergovindgupta commented 1 year ago

Thanks for your suggestion. I will update it soon...

at present : boundWithContainer is a boolean attribute that checks for offsetParent container to bound. For setting offsetParent you need to set position="absolute" to the parent container.

see example code https://codesandbox.io/s/move-rotate-resizer-demo-2-3x33ys

On Mon, 24 Jul 2023 at 17:52, mdellanave @.***> wrote:

Another nice improvements could be the option to define the dom parent of the resizer-container to avoid overflow [image: image] https://user-images.githubusercontent.com/19222174/255587402-83e000c6-e187-437f-b343-6e9f8d0173ca.png

The red area should be hidden because of the container bounds [image: image] https://user-images.githubusercontent.com/19222174/255587931-01599b27-ab51-4d92-b84c-5b9e46fcc367.png

— Reply to this email directly, view it on GitHub https://github.com/developergovindgupta/move-rotate-resizer/issues/1#issuecomment-1647811144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXYHBGPPGKFKRFOFBW72KTXRZSKBANCNFSM6AAAAAA2P67ESM . You are receiving this because you were mentioned.Message ID: @.***>

-- Sr. Javascript Developer Govind Prasad Gupta For Designhill (a platform owned by Reliable E Solutions Pvt Ltd) p: 7841849768, 9335057042 a: Designhill , B 106 , Sector 29, Near Signature Tower , Gurgaon Haryana 122001 w: www.designhill.com e: @. @.> Featured in: [image: http://www.huffingtonpost.com/casey-cavanagh/crowdsourcing-platforms-a_b_8314266.html?ir=India&adsSiteOverride=in]

http://thenextweb.com/insider/2016/01/08/7-must-know-content-marketing-trends-of-2016/

http://www.forbes.com/sites/amyguttman/2015/10/11/startups-why-giving-stuff-away-for-free-is-the-best-marketing-tool/

developergovindgupta commented 1 year ago

Updated move-rotate-resizer https://www.npmjs.com/package/move-rotate-resizer v 1.0.7

On Mon, 24 Jul, 2023, 10:01 pm Govind Prasad Gupta, < @.***> wrote:

Thanks for your suggestion. I will update it soon...

at present : boundWithContainer is a boolean attribute that checks for offsetParent container to bound. For setting offsetParent you need to set position="absolute" to the parent container.

see example code https://codesandbox.io/s/move-rotate-resizer-demo-2-3x33ys

On Mon, 24 Jul 2023 at 17:52, mdellanave @.***> wrote:

Another nice improvements could be the option to define the dom parent of the resizer-container to avoid overflow [image: image] https://user-images.githubusercontent.com/19222174/255587402-83e000c6-e187-437f-b343-6e9f8d0173ca.png

The red area should be hidden because of the container bounds [image: image] https://user-images.githubusercontent.com/19222174/255587931-01599b27-ab51-4d92-b84c-5b9e46fcc367.png

— Reply to this email directly, view it on GitHub https://github.com/developergovindgupta/move-rotate-resizer/issues/1#issuecomment-1647811144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXYHBGPPGKFKRFOFBW72KTXRZSKBANCNFSM6AAAAAA2P67ESM . You are receiving this because you were mentioned.Message ID: @.***>

-- Sr. Javascript Developer Govind Prasad Gupta For Designhill (a platform owned by Reliable E Solutions Pvt Ltd) p: 7841849768, 9335057042 a: Designhill , B 106 , Sector 29, Near Signature Tower , Gurgaon Haryana 122001 w: www.designhill.com e: @. @.> Featured in: [image: http://www.huffingtonpost.com/casey-cavanagh/crowdsourcing-platforms-a_b_8314266.html?ir=India&adsSiteOverride=in]

http://thenextweb.com/insider/2016/01/08/7-must-know-content-marketing-trends-of-2016/

http://www.forbes.com/sites/amyguttman/2015/10/11/startups-why-giving-stuff-away-for-free-is-the-best-marketing-tool/