[button] Implement paint culling for buttons
@@ -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
}
