Menu

#176 OLV hit test displays off-by-1 behaviour

C#_v2.9
accepted
None
1
2018-10-06
2018-10-06
No

Reported by Kris.Bennett@worrells.net.au 17-Sep-2018

Hello, just letting you know that there is a kind of major bug…

The hit boxes for you check boxes are a little off… What I mean is that it is possible to bypass your hit testing and use the built in hit test to check the boxes.

This means that:

  • it is possible to check a disabled checkbox
  • when you check a normal item this way then move the cursor off the item the item then unchecks

I am not doing any advanced drawing and am using the FormatRow event to color the text.

The hti variable seems to be correctly filled in this situation (to match the phantom check box hit areas) at the start of the OlvHitTest function, but then gets changed to be incorrect after:
if (this.OwnerDraw)

this.CalculateOwnerDrawnHitTest(hti, x, y);

is called.

I did not want to remove this check as a fix in case it breaks something else… but I tested it in this case with this part of the if condition removed and it seems to work.

Also on another note some of the checkboxes are offset differently for some reason; eg look at the X locations of the checkboxes in the first two lines.

2 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB