-
Notifications
You must be signed in to change notification settings - Fork 280
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 DRAG mode, this let you move object with the handlers and nothing else (ok) #371
Conversation
With this enhancement you can set objects to only drag by default. Sorry to duplicate the pull (last one can be removed, not sure how from my side). This push looks more correct and without conflicts. |
@themacboy woah I love the visual its kind of stunning! Ill pull this right now! |
@themacboy so i've attempted to make this a mode before too, but heres where I got stuck: each mode does something the others can't, but drag is available in every mode. So it doesn't fit the category right? If we wanted to make it a mode, it would only make sense to disable the ability to drag in every other mode right? I personally like this idea, I have wanted to separate out all the modes from the toolbar api completely, and maybe make each mode accessible via a button on the top of the screen or something. Our react offshoot does this well: https://github.com/ChrisLowe-Takor/react-leaflet-distortable-imageoverlay Let me know your thoughts on this! |
no problem! I understand what you are saying completely. I was basically saying I agree there should be a drag mode, but its a little complicated, because currently we can drag in every mode. So if we made it its own mode, then it would only make sense to disable dragging if you're in rotate, distort, mode etc. I am ok with this idea. We are a small group of contributors so we make our decisions based on if everyone agrees. |
I think it is good to have a simply drag mode, acording your thoughts we can express your idea in other way, more near to my concept : If we have a full set of modes, then we miss a NONE mode hehehe, and thats my drag mode hehehe. |
This could be a big leap for any newcomer's familiarity with the toolbar, but I don't see it as not implementable. If anything, this actually makes sense, and I can imagine a number of scenarios we'll use this in. Also, the "drag" in "all" buttons will now be replaced by the lock functionality, right @themacboy? @sashadev-sky I'm okay with this, but otherwise is fine too since I can understand the repeated drag enables the user will have to press every time they want to drag an image. Thanks! |
Aha, so this would be a "Drag by handles" mode, perhaps, to make it more clear? I think this may be preferable to changing all other modes. That way, everything else stays as it is, but we have a new tool called "DragByHandles" (so named to distinguish it from the existing default behavior of dragging the image itself). This new tool would be off/invisible by default, like the separate Rotate and Scale tools. But for use cases like @themacboy's, it could be enabled. How does that sound? |
I think such a new tool (and not changing any other behaviors) would be the least disruptive to the library, you know? |
@jywarren, Im with you. imo it is more usefull (and easy to manage) as a separate mode and not change any other. |
(sorry for my low english skill). I like to know if there is something else I can do or is needed to do in order to incorporate that change to general code. Otherwise I will do a separate script to modify original code in runtime, due I really need it in my project. Thanks in advance |
Can you take a look at how the current tools are implemented, and perhaps
try making a copy of one in order to add your "DragOnly" tool, in a PR? We
can then help you get that running smoothly, i think!
…On Thu, Aug 29, 2019 at 4:39 AM themacboy ***@***.***> wrote:
(sorry for my low english skill).
I like to know if there is something else I can do or is needed to do in
order to incorporate that change to general code.
Otherwise I will do a separate script to modify original code in runtime,
due I really need it in my project.
Thanks in advance
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#371?email_source=notifications&email_token=AAAF6J6BPNHPICXQR7SALYDQG6DLLA5CNFSM4IIK4ICKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5NXFIA#issuecomment-526086816>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAF6JZYWGWO7NBAFKJXKNTQG6DLLANCNFSM4IIK4ICA>
.
|
I think that now is all done. |
@themacboy this visuals are amazing like the way you designed it woah I merged huge pull request #393 I think you saw but do not worry I will take a look at this today and we will get this implemented!! |
@themacboy okay its rebased! Sorry there are commits all over the place... you were 46 commits behind main! Luckily nothing has changed as far as handles go. Now you just need to add your handler as a toolbar action. that is what you wanted right? first things first pick an icon! I will explain from there. I have been meaning to add a demo for how to add a custom tb action |
@themacboy oh ive got an idea and I think I understand what we are doing here. you want this to be the resting state of the image, as in technically not a mode. So it doesn't need a button. Instead I can add code to the toolbar buttons to toggle out of each mode as well, and into the image's default "drag" state. For our purposes we don't want a resting state with green star handles its a little confusing, but I can definitely help you finish it and when its done build a mode API around it to allow us to set it as non-default handle, similar to what we do with toolbar actions. It will be documented in README as addon :) I think I was already starting to try to do this anyways in #365 |
Hello Sahsa, I tryed to add the toolbar action in you Hotkeys branch, I love the changes you made there. Can you check if all is correct there? Or is needed I add this to this old branch? |
Here and example how I do my accident skecth: Here you can see how I draw and accident sketch, step by step, it is a few confusing due there are usually a lot of elements, hidden handlers and other hehehe. As you see I only let rotation on the elements, due all other is in the correct scale, and when I set the letters I only let people to drag it (no rotation needed here). I hope that show you what Im doing, better than my words hehehe Is incredible what Leaflet and DistortableImage let me do ! . |
@themacboy I rebased you to |
I have noticed when I test after rebase hehehe but thought that was and error in my code hahaha Now I see there is a conflict with: |
Sorry guys, Im still confused with GIT functions and broke a lot of thing trying to merge/rebase hahaha now I will try make it work again ---> 2 hours later Just added Action to toolbar. Looks working fine ! Yeah !!! Code is more readeable with your last changes !!! Thx |
ummm rotate is not working? I get the message:
I supose thats the bug, you comment before. |
@themacboy so happy its more readable!! I will pull this PR right now. I don't remember seeing this deprecation message, but a deprecation usually doesn't just break something. I will check it out. What version of Leaflet of using? I don't see that code in their source code for the latest version |
@themacboy this is really awesome!! After trying it out it made sense to me that it is different from other modes in that its the only marker that we can drag, so I think lets add it as a default action?
|
Also question where are all of the marker handle icons coming from? I've never added one myself and still don't know |
@themacboy ok this is all cleaned up! Lets go over a few small things that need to be done before merge? |
excuse ... I'm not sure how this works Do you think that we have made all the work relative to drag mode? or there is neede to do something else? If all is done, we can close the pull request? Sorry sorry sorry Im very noob in all relative to Git and cooperative coding. |
@themacboy haha its ok u did an awesome job with this PR! It had like 200 commits on it from other commits on the repo I had to rebase it. In order to move forward with my changes you have to Here are the things we must fix first:
After these 2 things are complete I will make a final push updating the documentation and bumping the version number of LDI :) |
Ok Sahs, trying to do ! but ... A din't found force push in Eclipse (my current ID). Im pretty sure that option is there, but I must learn where. Then I pushed a neew commint removing "/.project" from gitignore (sorry my fault) Now just added svg drag icon in svg folder, but when trying to run Currently I have reinstalled a lot of times grunt system, but not succes, Im reading about this problem in other forums, will see If i can correct it. At the moment I do a commint with the drag icon in svg. |
Ok, finally i run manually grunt-svg_sprite to get file added to sprite system. And grunt-svgmin still not working, then I created the minified version using svgo with same params used in icons task. I hope thats looks ok now hehehe p.d: It was a hard learning for me hahaha fortunatelly now I understand a bit more how all that works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@themacboy you did $ npm install -g grunt-cli
and didn't work for you?` but yes that is fine, whatever works for you!!
Ok so I checked out the files that shouldn't be there for you. In case useful for you again later, to checkout a file you accidentally committed, you do, for ex with .project
:
$ git rm --cached .project
$ gcm "Checkout .project"
$ git push origin modes
This is ready for merge now :) I'll just document in a follow-up honestly. Bumped to 0.8.5
and merging to main! and tomorrow if I get to update the docs ill publish to npm
Thank you for the awesome contribution
Congrats on merging your first pull request! 🙌🎉⚡️ |
A lot of thanks Sasha !!! Im old but im trying to learning fast, and very fast with all you help and your personal example ! Very happy !!! |
New feature, non fixes.
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
grunt
If tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!