Skip to content

Commit

Permalink
Centre checkmark in checkbox (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
agentsim authored Dec 7, 2021
1 parent 2d80ca0 commit 41118fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Bruno Dupuis
Christopher Noel Hesse
Marcin Zając
Laura Gallo
Tim Murison
Manmeet Singh
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ You can find its changes [documented below](#070---2021-01-01).

### Fixed

- Centre checkmark in checkbox ([#2036] by [@agentsim])
- `Notification`s will not be delivered to the widget that sends them ([#1640] by [@cmyr])
- `TextBox` can handle standard keyboard shortcuts without needing menus ([#1660] by [@cmyr])
- GTK Shell: Prevent mangling of newline characters in clipboard ([#1695] by [@ForLoveOfCats])
Expand Down Expand Up @@ -526,6 +527,7 @@ Last release without a changelog :(
[@lisael]: https://github.com/lisael
[@jenra-uwu]: https://github.com/jenra-uwu
[@klemensn]: https://github.com/klemensn
[@agentsim]: https://github.com/agentsim
[@jplatte]: https://github.com/jplatte

[#599]: https://github.com/linebender/druid/pull/599
Expand Down Expand Up @@ -806,6 +808,7 @@ Last release without a changelog :(
[#1978]: https://github.com/linebender/druid/pull/1978
[#1993]: https://github.com/linebender/druid/pull/1993
[#1996]: https://github.com/linebender/druid/pull/1996
[#2036]: https://github.com/linebender/druid/pull/2036
[#2064]: https://github.com/linebender/druid/pull/2064

[Unreleased]: https://github.com/linebender/druid/compare/v0.7.0...master
Expand Down
8 changes: 5 additions & 3 deletions druid/src/widget/checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ impl Widget<bool> for Checkbox {

if *data {
// Paint the checkmark
let x_offset = (rect.width() - 10.0) / 2.0;
let y_offset = (rect.height() - 8.0) / 2.0;
let mut path = BezPath::new();
path.move_to((4.0, 9.0));
path.line_to((8.0, 13.0));
path.line_to((14.0, 5.0));
path.move_to((x_offset, y_offset + 4.0));
path.line_to((x_offset + 4.0, y_offset + 8.0));
path.line_to((x_offset + 10.0, y_offset));

let style = StrokeStyle::new()
.line_cap(LineCap::Round)
Expand Down

0 comments on commit 41118fd

Please sign in to comment.