SnapToGrid with transform (x or y) causes negative starting points
gurraw opened this issue · 0 comments
gurraw commented
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);