Opened 18 years ago

Closed 17 years ago

#914 closed bug (fixed)

Extra characters with replicant + focus change for DeskCalc

Reported by: darkwyrm Owned by: jackburton
Priority: normal Milestone: R1
Component: Applications Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

If you drag a DeskCalc replicant to the desktop in full-size mode, click on another window, and then click directly on the input textbox in the replicant to give it the focus, clicking on it will cause what seems like a random characters to be entered into the box at the beginning of the text

Change History (6)

comment:1 by axeld, 18 years ago

Owner: changed from axeld to stippi

comment:2 by jackburton, 18 years ago

It's not a random character. Click on the textbox above the "(" and you'll see a "(". Click above the "9" and you'll see a "9". etc. etc. Looks like the DeskCalc MouseDown code needs some review.

comment:3 by jackburton, 17 years ago

Cc: axeld@… added

Now, I've done some research on this topic. Looks like the code in CalcView::MouseDown() is all correct, except it doesn't work :).

When DeskCalc is a replicant and you click on the textcontrol, the click is also forwarded to the parent view (and that's ok, nothing wrong with it), the passed point is also correct. The following calculation, though, result in something very weird: in CalcView::MouseDown()

int gridRow = (int)((point.y - sizeDisp) / sizeRow);

point.y - sizeDisp is negative, sizeRow is positive

gridRow, for some Reason, is 0 (?!?!?), so the next check passes while it shouldn't if (gridRow >= 0)... etc.

Has anyone any explanation for this ? BTW: if I print the result of the calculation as a float, without casting it to int, it shows the correct negative value.

comment:4 by jackburton, 17 years ago

Owner: changed from stippi to jackburton

comment:5 by jackburton, 17 years ago

Cc: axeld@… removed
Status: newassigned

Stupid me. It's a rounding problem. Thanks to Andrea Anzani for noticing.

comment:6 by jackburton, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev23061

Note: See TracTickets for help on using tickets.