Try to avoid corruption when moving cursor around in text boxes

svn path=/trunk/netsurf/; revision=10799
This commit is contained in:
Chris Young 2010-09-19 12:38:23 +00:00
parent 6e161d822c
commit f3bf62bdbb
1 changed files with 6 additions and 2 deletions

View File

@ -3623,6 +3623,8 @@ 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;
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);
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);
@ -3633,7 +3635,8 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height)
g->c_y = y;
g->c_h = height;
OnMenu(g->shared->win, AMI_MENU_PASTE);
if(option_kiosk_mode == false)
OnMenu(g->shared->win, AMI_MENU_PASTE);
}
void gui_window_remove_caret(struct gui_window *g)
@ -3643,7 +3646,8 @@ void gui_window_remove_caret(struct gui_window *g)
if(!g) return;
OffMenu(g->shared->win, AMI_MENU_PASTE);
if(option_kiosk_mode == false)
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);