Skip to content

Commit

Permalink
Change line to hline to simplify the code
Browse files Browse the repository at this point in the history
  • Loading branch information
YgorSouza committed Jan 6, 2024
1 parent 44a5a06 commit b8748ef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/egui/src/widgets/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl<'a> Checkbox<'a> {
Self::new(checked, WidgetText::default())
}

/// Display an indeterminate state (neither checked not unchecked)
/// Display an indeterminate state (neither checked nor unchecked)
///
/// This only affects the checkbox's appearance. It will still toggle its boolean value when
/// clicked.
Expand Down Expand Up @@ -445,11 +445,9 @@ impl<'a> Widget for Checkbox<'a> {

if indeterminate {
// Horizontal line:
ui.painter().add(Shape::line(
vec![
pos2(small_icon_rect.left(), small_icon_rect.center().y),
pos2(small_icon_rect.right(), small_icon_rect.center().y),
],
ui.painter().add(Shape::hline(
small_icon_rect.x_range(),
small_icon_rect.center().y,
visuals.fg_stroke,
));
} else if *checked {
Expand Down

0 comments on commit b8748ef

Please sign in to comment.