Comments (3)
Cool! It's been on my list to implement a resize increment feature so that snapping to a grid would be possible.
At first thought, it seems best to implement something like 'r-increment-x' and 'r-increment-y' so that you can snap to a grid vertically or horizontally without requiring both. Then from there, we'd just need to set up how it renders. I will work towards a solution for this in my spare time. That said, if you want to submit a pull request or fork the codepen, go for it :)
I tried to find the difference in the value of width, but each method seems to be reporting the same value to me, but I may have misunderstood. See this pen
from angular-resizable.
Hi, thx for your interest!
I implemented a first version on my project: a horizontal grid is now working and tested. But maybe could be improved!
Maybe two different properties are better, anyway I intended "rGrid" as an array of [x,y] positions.
Basically I modified the "dragging" function recalculating offset this way:
var gridX = scope.rGrid[0] || 1,
gridY = scope.rGrid[1] || 1;
offset = (axis == 'x')
? Math.round(((w+offset) - w) / gridX) * gridX
: Math.round(((h+offset) - h) / gridY) * gridY;
from angular-resizable.
I created a pull request to submit my code.
Mainly the snap to grid functionality, plus other minor changes, like the correction to width (the problem was on IE) and the original size value returned by updateInfo (to keep track of the size before resize).
from angular-resizable.
Related Issues (20)
- How to remove the grabber? HOT 1
- Please support touch screen from mobile devices HOT 2
- Resize a browser window HOT 1
- Disable resize HOT 2
- Bower missing files HOT 1
- Internet Explorer: top direction selected, section expanding bottom side
- General question
- Lot of open PRs HOT 2
- Is it compatible with Angular Material? HOT 1
- unbind handle
- Is it compatible with Angular 1.6.4 HOT 5
- "Usage" section of README not clear enough
- Is it possible resize table ?
- angular-resizable rNoThrottle doesn't work HOT 3
- Get current element of resize
- No Copyright notice HOT 4
- not an issue but a nice to have. Handles for resizing hidden by expression
- No unit tests HOT 1
- Rewritten for Angular 2+ ? HOT 1
- No license file
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 angular-resizable.