Comments (11)
If you look here, I did a plugin for it... http://svg.dabbles.info/snaptut-drag-limittransform
from snap.svg.
@ibrierley i tried to use this plugin but it doesn't work with my projet , the code I posted here is just a quick snapshot .
I don't know if there are other method without use viewbox
from snap.svg.
Can you clarify "doesnt work", do you get an error or something ? Can you post a jsfiddle ?
from snap.svg.
https://jsfiddle.net/f3gjw576/3/
@ibrierley i don't know why i can't move any where in the area of the viewbox , can you chekout ?
from snap.svg.
from snap.svg.
I do not understand what you mean ?
I can always drag and drop even on the code I sent you , it's just how to limit the drag and drop that i look for
from snap.svg.
The drag and drop on the original doesn't work correctly. If you drag it 100px, it only moves 50px (roughly).
from snap.svg.
Btw you can probably hack/fix it like the example, but you may find you have later issues with different setups, not sure. If you don't mind that, then you just need to add basic collision detection in your move handler.
from snap.svg.
I worked on it , but i have still the same issue
https://jsfiddle.net/ncL94f5v/3/
from snap.svg.
Sorry, I haven't had chance to look at this, and may not for a while currently. The transform stuff I did back in those days may be overcomplicated stuff, I'm really not sure without a bit of time to sit down and check if it really should work for this case actually...I note this old (potentially buggier if nested transforms are used) but simpler plugin version feels better possibly... http://svg.dabbles.info/snaptut-drag-limit it feels like it just needs bounding check offset minus the starting position or something.
Sorry I haven't had any real time to check, I like this stuff, it's possible I may get a bit more time in the future, but I can't guarantee anything atm.
from snap.svg.
thank you , it works now , problem solved . @ibrierley
from snap.svg.
Related Issues (20)
- CDNJS & jsDelivr : 0.5.1 tagged version contains 0.5.0
- Import Snap using Webpack imports-loader 2.0.0 not working HOT 1
- compilation error in dist/snap.svg.js lead to es6 import error
- imports-loader rule is not compatible with [email protected] HOT 2
- Solution for using snap-svg in Vue HOT 2
- '‹'
- Memory leak when there are SVG elements with foreignObject elements
- Docs / Types: Snap.animate with array of numbers
- Add SECURITY.md HOT 1
- how to save workspace in snap.svg? HOT 1
- how to snap object to all edges while drag? HOT 1
- Upgrading targetSDK causes issues loading SVG HOT 2
- Animated clock that worked for version 0.3.0 is failing with version 0.5.1 HOT 1
- Bug on Getting Started page
- how can i config in vite project HOT 2
- how can i config in webpack5.x project
- Incorrect ssl cert expired on snapsvg.io
- SSL Cert not working
- Element.drag() is working well on the PC, but not working well on the pad. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap.svg.