Share

KTable

Tracker: Bugs

5 getCellForCoordinates() failure on cell separator coordinate - ID: 1774481
Last Update: Settings changed ( ai-bombing )

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


Comment ( 1 )




Date: 2007-08-26 09:05
Sender: ai-bombingProject Admin


Oliver,

Thanks for the fix.
Is changed in CSV and will be contained in the next version.

Lorenz


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 3 )

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