From 907711f25baa76f23c285e07d26fba2e080c7c53 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 27 Sep 2008 21:33:00 +0000 Subject: Improved text cursor svn path=/trunk/netsurf/; revision=5449 --- amiga/gui.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 5504a28f0..a249498b3 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1802,30 +1802,34 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height) if(!g) return; gui_window_remove_caret(g); - g->c_x = x; - g->c_y = y; - g->c_h = height; GetAttr(SPACE_AreaBox,g->gadgets[GID_BROWSER],(ULONG *)&bbox); GetAttr(SCROLLER_Top,g->objects[OID_HSCROLL],&xs); - x = x - bbox->Left +xs; - GetAttr(SCROLLER_Top,g->objects[OID_VSCROLL],&ys); - y = y - bbox->Top + ys; SetAPen(g->win->RPort,3); - RectFill(g->win->RPort,x+bbox->Left,y+bbox->Top,x+bbox->Left+2,y+bbox->Top+height); + +// if(((x-xs) < bbox->Left) || ((x-xs) > (bbox->Left+bbox->Width)) || ((y-ys) < bbox->Top) || ((y-ys) > (bbox->Top+bbox->Height))) return; + + RectFill(g->win->RPort,x+bbox->Left-xs,y+bbox->Top-ys,x+bbox->Left+2-xs,y+bbox->Top+height-ys); + + g->c_x = x; + g->c_y = y; + g->c_h = height; } void gui_window_remove_caret(struct gui_window *g) { struct IBox *bbox; + int xs,ys; if(!g) return; GetAttr(SPACE_AreaBox,g->gadgets[GID_BROWSER],(ULONG *)&bbox); + GetAttr(SCROLLER_Top,g->objects[OID_HSCROLL],&xs); + GetAttr(SCROLLER_Top,g->objects[OID_VSCROLL],&ys); - BltBitMapRastPort(g->bm,g->c_x,g->c_y,g->win->RPort,bbox->Left+g->c_x,bbox->Top+g->c_y,2,g->c_h,0x0C0); + BltBitMapRastPort(g->bm,g->c_x,g->c_y,g->win->RPort,bbox->Left+g->c_x-xs,bbox->Top+g->c_y-ys,2+1,g->c_h+1,0x0C0); g->c_h = 0; } -- cgit v1.2.3