if cursor has no start, don't calc any end

This commit is contained in:
Anselm R. Garbe 2006-06-29 16:49:58 +02:00
parent 72d56f20f5
commit 1ea88adf6f

View File

@ -136,7 +136,8 @@ blitz_brelease_input(BlitzInput *i, int x, int y)
{
char *oend;
if(!(i->drag = blitz_ispointinrect(x, y, &i->rect)))
if(!(i->drag = blitz_ispointinrect(x, y, &i->rect)) ||
!i->curstart)
return False;
oend = i->curend;
i->curend = charof(i, x, y);
@ -151,7 +152,8 @@ blitz_bmotion_input(BlitzInput *i, int x, int y)
{
char *oend;
if(!i->drag || !(i->drag = blitz_ispointinrect(x, y, &i->rect)))
if(!i->drag || !(i->drag = blitz_ispointinrect(x, y, &i->rect))
|| !i->curstart)
return False;
oend = i->curend;