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 , 18 years ago
Owner: | changed from | to
---|
comment:2 by , 18 years ago
comment:3 by , 17 years ago
Cc: | 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 , 17 years ago
Owner: | changed from | to
---|
comment:5 by , 17 years ago
Cc: | removed |
---|---|
Status: | new → assigned |
Stupid me. It's a rounding problem. Thanks to Andrea Anzani for noticing.
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.