-
Notifications
You must be signed in to change notification settings - Fork 283
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
Restore original proportions tool and bug fixes #274
Conversation
@jywarren @ebarry so I used a random screenshot I found on my computer because its easier to see whats going on. please reference point 1 in PR description for the functionality description of restore. The one thing to note here is that it restores it to its original proportions, ones that we initially manipulate when we first put it on the map. So that is why it appears such a different shape. Here is another example using the actual demo image, where its much more subtle (the image is slightly larger after restore): |
@jywarren ok i think this part is ready to go and i'll address the pending points in a follow up! Let me know your thoughts! I left some commented windows behind for the follow up with the rotation stuff |
I like this, but I'm a bit cautious about the SVG change. Will it be easy to find new SVGs that match the style, and is it straightforward how to add new SVGs? If this will be addressed in documentation, that's cool! I just want to see what you're thinking on this. |
Thanks!!! |
@jywarren yes! All the icon libraries provide their fonts in svg format. Working on the docs for how to use it right now! I configured it to work with grunt so it wont be too complicated and im sure people would be interested in learning how svg works! |
@jywarren ok this is ready! Final final UI: these are 20px. Did you want them at 18px? This is 18: It seems like the icons on the right look better in 20 and the ones on the left in 18 so not sure which to go with. Also I bumped to version And here is the link to the final wiki doc: https://github.com/publiclab/Leaflet.DistortableImage/wiki/SVG-Icon-System, which I link to in the README under contributing |
@jywarren ok I remembered you liked them smaller and I decided 18px was better so I just went with that. Now I just need advisal on the version bump and its ready. If we never released |
Fixes #272 (<=== Add issue number here)
#250
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!
=======================================================
Originally opened this to address #272 but branched out into bug fixes and enhancements
functionality to restore to original proportions (via
_restore
method) has been added and also added to toolbar. Restores the images scale and proportions, but keeps rotation and location intactDemo coordinates flipped: A while back I brought up that we flip our corner coordinates. (the top right corner is corner 0, and top left is corner 1). I realized this is not a problem with our code, but just that the coordinates we use in our demo are flipped. Changing this should make development a lot easier in the future and also fixes a bug: all the images in our demo appear on the map flipped backwards (like a mirror image), it just happens to not be that noticable with the images we were using. I noticed this when I used a picture with words on it in the demo.
Corresponding README updates and other small fixes there
Small refactoring - added an
ImageUtil
classIcons are now optimized as svgs, allowing for 1) performance enhancement, 2) ability to use any icons from any library, 3) browser support
grunt-svgmin
andgrunt svg_sprite
plugins for dev workflowsvgforeverybody
polyfill_updateToolbarPos
pending
this.rotation
. Figured since I went through the functionality of calculating the rotation angle, I can extract it into the methods mentioned by the user here and add it to API:image.getRotate()
/image.setRotate(45)
_updateToolbarPos
instead=======================================================