[button] Implement paint culling for buttons
This commit is contained in:
parent
02b1e82a6e
commit
4db9b82435
1 changed files with 21 additions and 19 deletions
|
@ -389,6 +389,7 @@ impl Widget for Button {
|
|||
let id = ui.make_position_id();
|
||||
let response = ui.interact(rect, id, sense);
|
||||
|
||||
if ui.clip_rect().intersects(rect) {
|
||||
let visuals = ui.style().interact(&response);
|
||||
let text_cursor = ui
|
||||
.layout()
|
||||
|
@ -410,6 +411,7 @@ impl Widget for Button {
|
|||
.unwrap_or_else(|| visuals.text_color());
|
||||
ui.painter()
|
||||
.galley(text_cursor, galley, text_style, text_color);
|
||||
}
|
||||
|
||||
response
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue