aboutsummaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c
index 2926d4e..cf6bd7f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -698,7 +698,7 @@ void ensure_run(struct frame *fr, struct edit_pos cpos)
int find_cursor(struct frame *fr, double x, double y, struct edit_pos *pos)
{
- double pad = fr->pad_t;
+ double pad;
int i;
if ( fr == NULL ) {
@@ -706,6 +706,8 @@ int find_cursor(struct frame *fr, double x, double y, struct edit_pos *pos)
return 1;
}
+ pad = fr->pad_t;
+
for ( i=0; i<fr->n_paras; i++ ) {
double npos = pad + paragraph_height(fr->paras[i]);
if ( npos > y ) {