aboutsummaryrefslogtreecommitdiffstats
path: root/src/display.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-23 19:17:00 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-23 19:21:54 -0400
commitf8329615c7b7b2697d3ccfd227b711ff60dc53b7 (patch)
treef1bde29660ba18d1642980ef22a355c2a39095b0 /src/display.c
parent219bed8179b62db44b3a55e445733dcd9feed785 (diff)
downloadrunes-f8329615c7b7b2697d3ccfd227b711ff60dc53b7.tar.gz
runes-f8329615c7b7b2697d3ccfd227b711ff60dc53b7.zip
be more consistent
Diffstat (limited to 'src/display.c')
-rw-r--r--src/display.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/display.c b/src/display.c
index e8483f4..df57df7 100644
--- a/src/display.c
+++ b/src/display.c
@@ -497,10 +497,10 @@ void runes_display_use_normal_buffer(RunesTerm *t)
void runes_display_set_scroll_region(
RunesTerm *t, int top, int bottom, int left, int right)
{
- top = (top < 1 ? 1 : top) - 1;
- bottom = (bottom > t->rows ? t->rows : bottom) - 1;
- left = (left < 1 ? 1 : left) - 1;
- right = (right > t->cols ? t->cols : right) - 1;
+ top = top < 0 ? 0 : top;
+ bottom = bottom > t->rows - 1 ? t->rows - 1 : bottom;
+ left = left < 0 ? 0 : left;
+ right = right > t->cols - 1 ? t->cols - 1 : right;
if (left != 0 || right != t->cols - 1) {
fprintf(stderr, "vertical scroll regions not yet supported\n");