Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5280 closed bug (fixed)

ui.position generates different position in static context

Reported by: AzaToth Owned by:
Priority: critical Milestone: 1.8.1
Component: ui.position Version: 1.8rc3
Keywords: wobbling Cc:
Blocked by: Blocking:

Description

as seen in http://jsbin.com/itato4/14, if a span in a div has a call to position executed twice, it wont get the same position in the second call. In a loop it becomes a "wobbling" effect (unwanted often).

Visible in firefox, not visible in chrome.

Change History (5)

comment:1 follow-up: Changed 7 years ago by paul.irish

You can do a bitwise equivalent of Math.floor(num) with num

comment:2 in reply to: ↑ 1 Changed 7 years ago by paul.irish

Replying to paul.irish: You can do a bitwise equivalent of Math.floor(num) with ~~num

comment:3 Changed 7 years ago by scottgonzalez

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in 9541bd0bf2ca72795e8f2b2c1d3accc32afcac96 using parseInt() which is what core does for pixel values.

comment:4 Changed 6 years ago by rdworth

  • Milestone changed from 1.9 to 1.8.1

comment:5 Changed 6 years ago by gethinw

Is there a reason why parseInt() was used rather than Math.round()? This choice can cause 1px offset issues in Firefox where decimal values >= .5 are concerned. See http://jsbin.com/uceje4/2

Note: See TracTickets for help on using tickets.