Skip to content

Commit

Permalink
fix: align checkboxes to line instead of box (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
kokoISnoTarget authored Apr 14, 2024
1 parent 596d6d2 commit 4c91193
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,14 @@ impl Renderer {
}
}
if let Some(is_checked) = text_box.is_checkbox {
let line_height = text_box.line_height(self.zoom);
let min = (
scrolled_pos.0 - box_size * 1.5,
scrolled_pos.1 + size.1 / 2. - box_size / 2.,
scrolled_pos.1 + line_height / 2. - box_size / 2.,
);
let max = (
scrolled_pos.0 + box_size - box_size * 1.5,
scrolled_pos.1 + size.1 / 2. + box_size / 2.,
scrolled_pos.1 + line_height / 2. + box_size / 2.,
);
if max.0 < screen_size.0 - DEFAULT_MARGIN - centering {
if is_checked {
Expand Down

0 comments on commit 4c91193

Please sign in to comment.