Skip to content
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

SnapToGrid with transform (x or y) causes negative starting points #15

Open
gurraw opened this issue Mar 7, 2017 · 0 comments
Open

Comments

@gurraw
Copy link

gurraw commented Mar 7, 2017

Trying to center line endings in the grid cells using the code below. Works everywhere except at the very top and at the far left. where the starting point is set to -64 (x resp y) instead of 0.

var drawing = SVG('svgDrawLayer');
var rect = drawing.polyline().attr('stroke-width',1).transform({x:32, y:32});
drawing.on('mousedown', function(e){		
            rect.draw(e, {snapToGrid:64});
        }, false);
drawing.on('mouseup', function(e){
            rect.draw('stop', e);
        }, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant