Skip to content

Commit

Permalink
fixed bevacqua#14, miscalculation on edges for position candidacy
Browse files Browse the repository at this point in the history
  • Loading branch information
bevacqua committed Feb 25, 2016
1 parent df11db5 commit c3c4d41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.6.7 Miscalculation

- Fixed a long-standing bug where candidate positioning would be off by one position

# 3.6.6 Living on the Edge

- Fixed a bug with clicks on IE7, IE8, IE9
Expand Down
4 changes: 2 additions & 2 deletions dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ function dragula (initialContainers, options) {
for (i = 0; i < len; i++) {
el = dropTarget.children[i];
rect = el.getBoundingClientRect();
if (horizontal && rect.left > x) { return el; }
if (!horizontal && rect.top > y) { return el; }
if (horizontal && (rect.left + rect.width / 2) > x) { return el; }
if (!horizontal && (rect.top + rect.height / 2) > y) { return el; }
}
return null;
}
Expand Down

0 comments on commit c3c4d41

Please sign in to comment.