diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2008-09-27 21:33:00 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2008-09-27 21:33:00 +0000 |
commit | 907711f25baa76f23c285e07d26fba2e080c7c53 (patch) | |
tree | be6139b7614a37da34b7aebc2a33c9c75d6b1a9d /amiga/gui.c | |
parent | 44d88dcee0fb40a82c7474929c59b8fc34221412 (diff) | |
download | netsurf-907711f25baa76f23c285e07d26fba2e080c7c53.tar.gz netsurf-907711f25baa76f23c285e07d26fba2e080c7c53.tar.bz2 |
Improved text cursor
svn path=/trunk/netsurf/; revision=5449
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-x | amiga/gui.c | 20 |
1 files 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; } |