PDA

View Full Version : [FIXED] El.center not centering properly



me2
26 Feb 2009, 11:43 AM
In com.extjs.gxt.ui.client.core.El the center(boolean constrainViewport) method appears to have a bug that is incorrectly computing the proper top/left coordinates.

The following code is what looks wrong (around line 350 in the source):


int left = (width / 2) - (w / 2) + container.getScrollTop();
int top = (height / 2) - (h / 2) + container.getScrollLeft();The "left" value is using the containers scroll value from the top, instead of from the left, and the "top" value is using the containers scroll value from the left instead of from the top.

The line # was take from the 1.2.3 release of GXT

sven
26 Feb 2009, 11:47 AM
Yes looks a bit wrong. I look into it.

me2
26 Feb 2009, 11:52 AM
Thanks - looks like the El.center(Element container) method might have the same problem, lines 384, 385

sven
1 Apr 2009, 4:18 AM
Fixed in SVN.