When calling getCellForCoordinates(int x, int y) with an x-coordinate that
lies between two cells (ie. the 1-pixel cell separator), the function
always returns a cell x-coordinate of 0 instead of the correct one.
The problem is in the last if() in the loop:
for (int i=0; width<x; i++) {
if (i>=m_Model.getColumnCount())
return new Point(-1,-1);
width+=getColumnWidth(i);
if (x<width) cell.x = i;
}
In case of a separator coordinate, the condition x==width is true after the
width+=getColumnWidth(i) statement.
Thus the if (x<width) is false, but the loop exit condition width<x is
true! The loop is exited without changing the result x cell coordinate from
its default 0.
To fix this, modify the last if() condition to use x<=width instead of <.
Thanks, Oli
marc-oliver.straub@verigy.com
Nobody/Anonymous ( nobody ) - 2007-08-15 05:55
5
Closed
Accepted
Nobody/Anonymous
Rendering
None
Public
|
Date: 2007-08-26 09:05
|
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2007-08-26 09:06 | ai-bombing |
| resolution_id | None | 2007-08-26 09:06 | ai-bombing |
| close_date | - | 2007-08-26 09:06 | ai-bombing |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use