Skip to content

Commit

Permalink
Fix ticks in compass zoom for fractional levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Jan 19, 2011
1 parent ff941e4 commit 3587b87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion polymaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ po.compass = function() {
g.setAttribute("transform", "translate(" + x + "," + y + ")");
dragRect.setAttribute("transform", "translate(" + -x + "," + -y + ")");
for (var i in ticks) {
i == map.zoom()
Math.abs(i - map.zoom() +.5) <= .5
? ticks[i].setAttribute("class", "active")
: ticks[i].removeAttribute("class");
}
Expand Down
2 changes: 1 addition & 1 deletion polymaps.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Compass.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ po.compass = function() {
g.setAttribute("transform", "translate(" + x + "," + y + ")");
dragRect.setAttribute("transform", "translate(" + -x + "," + -y + ")");
for (var i in ticks) {
i == map.zoom()
Math.abs(i - map.zoom() +.5) <= .5
? ticks[i].setAttribute("class", "active")
: ticks[i].removeAttribute("class");
}
Expand Down

0 comments on commit 3587b87

Please sign in to comment.