Skip to content

Commit

Permalink
Position: Handle sub-pixel offsets better in Firefox. Fixes #6000 - P…
Browse files Browse the repository at this point in the history
…osition: Sometimes positioning is off by 1px in Firefox.
  • Loading branch information
scottgonzalez committed Dec 1, 2010
1 parent 40135bb commit c667cff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/jquery.ui.position.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ $.fn.position = function( options ) {
}

// prevent fractions (see #5280)
position.left = parseInt( position.left );
position.top = parseInt( position.top );
position.left = Math.round( position.left );
position.top = Math.round( position.top );

collisionPosition = {
left: position.left - marginLeft,
Expand Down

2 comments on commit c667cff

@jzaefferer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseInt() was used only for "rounding", not for parsing?

@scottgonzalez
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, at this point we're always dealing with numbers.

Please sign in to comment.