Skip to content

Commit 78b31d0

Browse files
author
Stephan Dilly
committed
fix crash in help popup (closes #63)
1 parent e59200c commit 78b31d0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Fixed
10+
- fix crash help in small window size ([#63](https://github.com/extrawurst/gitui/issues/63))
11+
912
## [0.2.5] - 2020-05-16
1013
### Added
1114
- introduced proper changelog

src/ui/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ pub fn centered_rect_absolute(
4747
r: Rect,
4848
) -> Rect {
4949
Rect::new(
50-
(r.width - width) / 2,
51-
(r.height - height) / 2,
52-
width,
53-
height,
50+
(r.width.saturating_sub(width)) / 2,
51+
(r.height.saturating_sub(height)) / 2,
52+
width.min(r.width),
53+
height.min(r.height),
5454
)
5555
}
5656

0 commit comments

Comments
 (0)