Ticket #5280 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

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.

Attachments

jquery.ui.position.test.patch Download (1.3 KB) - added by AzaToth 4 years ago.
patch for adding test for this bug to the unit test
0001-Subpixel-rendering.patch Download (1.0 KB) - added by AzaToth 4 years ago.
Eventual implementation
0001-Subpixel-rendering.2.patch Download (946 bytes) - added by AzaToth 4 years ago.
updated to use

Change History

Changed 4 years ago by AzaToth

patch for adding test for this bug to the unit test

Changed 4 years ago by AzaToth

Eventual implementation

comment:1 follow-up: ↓ 2 Changed 4 years ago by paul.irish

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

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

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

Changed 4 years ago by AzaToth

updated to use

comment:3 Changed 4 years ago by scott.gonzalez

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

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

comment:4 Changed 4 years ago by rdworth

  • Milestone changed from 1.9 to 1.8.1

comment:5 Changed 4 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.