Permalink
Browse files

make prettify actually commit to the undo stack

  • Loading branch information...
Daniel Thornton
Daniel Thornton committed May 1, 2012
1 parent 9942d36 commit c35f82a4f462c976459afda5b671bfbc817245ba
Showing with 8 additions and 5 deletions.
  1. +8 −5 web/js/reductions.js
View
@@ -478,12 +478,15 @@ var Reduction = Class.extend({
if (kinetic > kmax) {
self.board.force_tick = setTimeout($.proxy(self.prettify_force_tick, self), 33);
- } else if (self.board.snap) {
- for (i = 0; i < nodes.length; i++) {
- n = nodes[i];
- n.x = Math.round(n.x/self.board.snap_size)*self.board.snap_size;
- n.y = Math.round(n.y/self.board.snap_size)*self.board.snap_size;
+ } else {
+ if (self.board.snap) {
+ for (i = 0; i < nodes.length; i++) {
+ n = nodes[i];
+ n.x = Math.round(n.x/self.board.snap_size)*self.board.snap_size;
+ n.y = Math.round(n.y/self.board.snap_size)*self.board.snap_size;
+ }
}
+ self.board.undoAdd();
}
return kinetic;

0 comments on commit c35f82a

Please sign in to comment.