Jump to content

AndreR

Members
  • Posts

    1
  • Joined

  • Last visited

  1. Hello, first of all I have to admit I really enjoy uGFX. I've been using STemWin before and moving to uGFX was absolutely the right decision. It's great having the source code. Which also brings me to the reason of this post. I came across this: static inline void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) { pt->x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx); pt->y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy); } The problem here is, that pt->x is assigned an new value, which is used again in the next line. This is certainly not intended. In my extreme case, X and Y of the touch interface and the display were swapped. Leading to y being assigned to x and both values used again to calculate y. Thereby, Y was too large and has always been clipped. I suggest the following: static inline void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) { coord_t x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx); coord_t y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy); pt->x = x; pt->y = y; } Cheers, Andre
×
×
  • Create New...