Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r--source/blender/editors/space_text/text_ops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index eea3e4d7958..f496d004ae2 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -29,13 +29,14 @@
#include "DNA_text_types.h"
#include "BLI_blenlib.h"
+#include "BLI_math_base.h"
#include "BLT_translation.h"
#include "PIL_time.h"
#include "BKE_context.h"
-#include "BKE_library.h"
+#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_text.h"
@@ -2544,7 +2545,7 @@ static void text_scroll_state_init(TextScroll *tsc, SpaceText *st, ARegion *ar)
tsc->state.ofs_init[1] = st->top;
tsc->state.ofs_max[0] = INT_MAX;
- tsc->state.ofs_max[1] = text_get_total_lines(st, ar) - (st->runtime.viewlines / 2);
+ tsc->state.ofs_max[1] = max_ii(0, text_get_total_lines(st, ar) - (st->runtime.viewlines / 2));
tsc->state.size_px[0] = st->runtime.cwidth_px;
tsc->state.size_px[1] = TXT_LINE_HEIGHT(st);