Skip to content

Commit

Permalink
fix crash in help popup (closes #63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed May 16, 2020
1 parent e59200c commit 78b31d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- fix crash help in small window size ([#63](https://github.com/extrawurst/gitui/issues/63))

## [0.2.5] - 2020-05-16
### Added
- introduced proper changelog
Expand Down
8 changes: 4 additions & 4 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ pub fn centered_rect_absolute(
r: Rect,
) -> Rect {
Rect::new(
(r.width - width) / 2,
(r.height - height) / 2,
width,
height,
(r.width.saturating_sub(width)) / 2,
(r.height.saturating_sub(height)) / 2,
width.min(r.width),
height.min(r.height),
)
}

Expand Down

0 comments on commit 78b31d0

Please sign in to comment.