Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix #2434 - wrong calculation of offset #2437

Open
wants to merge 1 commit into from

3 participants

@rrelmy

Fixes the bug described in #2434

Offsets are rounded correctly now

@rrelmy

Does something block this commit to be merged?

@ibolmo
Owner

Are you using sub pixels when setting the left and top?

@ibolmo
Owner

Update the PR to use String.toFloat instead.

@rrelmy rrelmy fix #2434 - wrong calculation of offset
dc1ad82
@rrelmy

The problem mostly occurs on slideshows if you use an element centered with auto margins within an element of odd width or using percents in width/padding.

The pull request has been updated.

@ibolmo
Owner

This is going to be on hold, until we get a spec to check for this. You're welcome to add one yourself, or wait about a week to get a hold of the pending PR that reduces the complexity to test MooTools.

@ibolmo ibolmo added bug specs labels
@ibolmo ibolmo modified the milestone: 1.5.1, 1.5
@SergioCrisostomo SergioCrisostomo referenced this pull request in mootools/mootools-more
Closed

Drag grid alignment does not honor scrolling. #1262

@SergioCrisostomo SergioCrisostomo modified the milestone: 1.5.2, 1.5.1
@ibolmo ibolmo added the incomplete label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 3, 2014
  1. @rrelmy

    fix #2434 - wrong calculation of offset

    rrelmy authored Rémy committed
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Element/Element.Dimensions.js
View
4 Source/Element/Element.Dimensions.js
@@ -100,8 +100,8 @@ Element.implement({
isFixed = (styleString(this, 'position') == 'fixed');
return {
- x: bound.left.toInt() + elemScrolls.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft,
- y: bound.top.toInt() + elemScrolls.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop
+ x: bound.left.toFloat() + elemScrolls.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft,
+ y: bound.top.toFloat() + elemScrolls.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop
};
}
Something went wrong with that request. Please try again.