diff options
-rw-r--r-- | src/ui/documentwidget.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index aa24be48..2a3a2509 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -87,6 +87,12 @@ static iRect documentBounds_DocumentWidget_(const iDocumentWidget *d) { | |||
87 | rect.pos.x = bounds.size.x / 2 - rect.size.x / 2; | 87 | rect.pos.x = bounds.size.x / 2 - rect.size.x / 2; |
88 | rect.pos.y = top_Rect(bounds) + margin; | 88 | rect.pos.y = top_Rect(bounds) + margin; |
89 | rect.size.y = height_Rect(bounds) - 2 * margin; | 89 | rect.size.y = height_Rect(bounds) - 2 * margin; |
90 | if (size_GmDocument(d->doc).y < rect.size.y) { | ||
91 | /* Center vertically if short. */ | ||
92 | int offset = (rect.size.y - size_GmDocument(d->doc).y) / 2; | ||
93 | rect.pos.y += offset; | ||
94 | rect.size.y = size_GmDocument(d->doc).y; | ||
95 | } | ||
90 | return rect; | 96 | return rect; |
91 | } | 97 | } |
92 | 98 | ||