Hi all, I've been having problems with the GrDisplayCursor function. In my case, sometimes the cursor is drawn partially. I think I've found the error in GrDisplayCursor. If the cursor is 8 pixels wide, the work area is 16 pixels wide. Let's supose a call to GrDisplayCursor with C->xcord = 323: C->xcord = 323; C->xoffs = 0; C->xsize = 8; C->xwork = 16; ----------------------- call GrDisplayCursor xpos = 323; xsiz = 16; xwrk = 312; ... (save bitmap from 312 to 327) [our cursor goes from 323 to 330] ... xpos = 11; xsiz = 8; if(xsiz > (C->xwork - xpos)) xsiz = C->xwork - xpos; ====> xsiz = 5; (draw a cursor 5 pixels wide) IMHO this is a bug. I think GrDisplayCursor tries to place the cursor in the middle of the work area, but in a coordinate multiple of 8: xwrk = (xpos - (C->xsize >> 1)) & ~7; but sometimes the result lets the cursor partially outside the work area. I think after this line is necesary a correction: if((xpos + C->size) > (xwrk + xsiz)) xwrk += 8; The same applies to vertical coordinates. What do you think about it? Josu Onandia Dpto. I+D Software. e-mail: jonandia@fagorautomation.es ---------------------------------------------------- Fagor Automation, S.Coop. Barrio San Andres, s/n - P.O. Box. 144 Mondragon 20500 - SPAIN http://www.fagorautomation.mcc.es
participants (2)
-
Hartmut Schirmer -
Josu Onandia