|
|
I can't answer to rust implications (don't know anything about it), but I'm guessing that's not an issue.
The purpose of the returned xmax is not used to determine where the widget is drawn (that position is determined by the label_x() + label_w()), which I think is what you're assuming.
The purpose of the returned xmax is used to calculate the horizontal scrollbar's width (as described in the docs for draw_item_content()) which is based on the widest item in the entire tree.
When a widget is assigned to the item, it appears to the right of the item, its position determined by label_x() + label_w(), and therefore when it's drawn, its xmax always overrides the item's xmax, because it will be drawn to the right of the item.
If you override draw_item_content(), you're supposed to draw within the xywh of the label_x()/label_y()/label_w()/label_h() dimensions, as shown in the example code, and return the xmax of your actually drawn content, in case it's less than the label's width. This helps the horizontal scrollbar be as precise as possible when the item is the right-most content being drawn. But that's not the case when a widget is assigned, as the widget becomes the right-most content.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
[ Direct Link to Message ] | |
|
| |