Return empty rectangle from GetItemRect() if item is not visible

This was already the case if the item was not visible because its parent
was not expanded, but now make it also true for the items which are not
visible due to the current scrollbar position.

Add unit tests checking for this and also verifying that GetItemRect()
returns the coordinates in the physical window coordinates.
This commit is contained in:
Vadim Zeitlin
2018-11-04 17:50:55 +01:00
parent 9b7757c44d
commit 9460038b3f
3 changed files with 43 additions and 4 deletions

View File

@@ -1448,8 +1448,9 @@ public:
/**
Returns item rectangle.
If item is not currently visible because its parent is collapsed,
return an empty rectangle.
If item is not currently visible, either because its parent is
collapsed or it is outside of the visible part of the control due to
the current vertical scrollbar position, return an empty rectangle.
Coordinates of the rectangle are specified in wxDataViewCtrl client
area coordinates.