From bcfda49d4c7190c9a3969b23aeea320f4f886ebd Mon Sep 17 00:00:00 2001
From: "p.kosyh"
Date: Tue, 24 Nov 2009 07:48:47 +0000
Subject: [PATCH] box_norm fix
---
src/sdl-instead/graphics.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/sdl-instead/graphics.c b/src/sdl-instead/graphics.c
index 0d99b6a..0ce25fc 100644
--- a/src/sdl-instead/graphics.c
+++ b/src/sdl-instead/graphics.c
@@ -1906,14 +1906,14 @@ void txt_box_norm(textbox_t tbox)
{
struct textbox *box = (struct textbox *)tbox;
struct line *line;
+ int off = box->off;
+
if (!box->lay)
return;
for (line = box->lay->lines; line; line = line->next) {
- if (box->off < line->h) {
- box->line = line;
+ if (off < line->h)
break;
- }
- box->off -= line->h;
+ off -= line->h;
}
box->line = box->lay->lines;
}