mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 07:10:04 -04:00
[button] Implement paint culling for buttons
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user