From e8ca07b0dc481d4065f5a43749116ffdc5c64e0b Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 19 Mar 2011 13:00:45 +0000 Subject: Redraw the area under a caret when it is cleared, rather than relying on a potentially out-of-date off-screen copy of what used to be there. svn path=/trunk/netsurf/; revision=12107 --- amiga/gui.c | 15 +++++---------- amiga/gui.h | 7 ++++--- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index 9680b671f..5abf40472 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3755,14 +3755,12 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height) if(((x-xs) <= 0) || ((x-xs+2) >= (bbox->Width)) || ((y-ys) <= 0) || ((y-ys) >= (bbox->Height))) return; -/* Backup the area under the cursor - args need checking - BltBitMap(g->shared->win->RPort->BitMap, bbox->Left+x-xs, bbox->Top+y-ys, - browserglob.bm, x-xs, y-ys,2+1, height+1, 0x0C0, 0xff, NULL); -*/ + g->c_w = 2; SetDrMd(g->shared->win->RPort,COMPLEMENT); - RectFill(g->shared->win->RPort,x+bbox->Left-xs,y+bbox->Top-ys,x+bbox->Left+2-xs,y+bbox->Top+height-ys); + RectFill(g->shared->win->RPort, x + bbox->Left - xs, y + bbox->Top - ys, + x + bbox->Left + g->c_w - xs, y+bbox->Top + height - ys); SetDrMd(g->shared->win->RPort,JAM1); @@ -3787,11 +3785,8 @@ void gui_window_remove_caret(struct gui_window *g) (g->shared->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) OffMenu(g->shared->win, AMI_MENU_PASTE); - GetAttr(SPACE_AreaBox, g->shared->objects[GID_BROWSER], (ULONG *)&bbox); - ami_get_hscroll_pos(g->shared, (ULONG *)&xs); - ami_get_vscroll_pos(g->shared, (ULONG *)&ys); - - BltBitMapRastPort(browserglob.bm,g->c_x-xs,g->c_y-ys,g->shared->win->RPort,bbox->Left+g->c_x-xs,bbox->Top+g->c_y-ys,2+1,g->c_h+1,0x0C0); + ami_do_redraw_limits(g, g->shared->bw, g->c_x, g->c_y, + g->c_x + g->c_w + 1, g->c_y + g->c_h + 1); g->c_h = 0; } diff --git a/amiga/gui.h b/amiga/gui.h index 9f90112e8..c31d2cc1a 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -116,9 +116,10 @@ struct gui_window struct gui_window_2 *shared; int tab; struct Node *tab_node; - int c_x; - int c_y; - int c_h; + int c_x; /* Caret X posn */ + int c_y; /* Caret Y posn */ + int c_w; /* Caret width */ + int c_h; /* Caret height */ int c_h_temp; int scrollx; int scrolly; -- cgit v1.2.3