fix crash in help popup (closes #63)

This commit is contained in:
Stephan Dilly 2020-05-16 23:26:53 +02:00
parent e59200ceea
commit 78b31d046b
2 changed files with 7 additions and 4 deletions

View file

@ -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

View file

@ -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),
)
}