Quantcast
Channel: wxWidgets: Ticket Query
Viewing all articles
Browse latest Browse all 66

#9956: wxGenericTreeControl: Cache GetTextExtent results to greatly speedup CalculatePositions

$
0
0

Every time CalculatePositions is called (e.g. from adding/removing/expanding/collapsing items), wxGenericTreeCtrl calls GetTextExtent for every single item in the tree.

GetTextExtent is a relatively slow function, so tree operations on trees with hundreds if not thousands of items take a lot of time.

With the attached patch, the result of GetTextExtent is cached and only discarded if the item text or item attributes change.


Viewing all articles
Browse latest Browse all 66

Trending Articles