Fix bugs in newmouse framework

ugfx_release_2.6
inmarket 2014-10-07 21:52:00 +10:00
parent 3af0498a4c
commit ccf05e8c0a
1 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ static void GetMouseReading(GMouse *m) {
// Is this just movement jitter // Is this just movement jitter
if (pj->move > 0) { if (pj->move > 0) {
diff = (uint32_t)(r.x - m->r.x) * (uint32_t)(r.x - m->r.x) + (uint32_t)(r.y - m->r.y) * (uint32_t)(r.y - m->r.y); diff = (uint32_t)(r.x - m->r.x) * (uint32_t)(r.x - m->r.x) + (uint32_t)(r.y - m->r.y) * (uint32_t)(r.y - m->r.y);
if (diff > (uint32_t)pj->move * (uint32_t)pj->move) { if (diff < (uint32_t)pj->move * (uint32_t)pj->move) {
r.x = m->r.x; r.x = m->r.x;
r.y = m->r.y; r.y = m->r.y;
} }
@ -344,7 +344,7 @@ static void MousePoll(void *param) {
} }
static inline void CalibrationCrossClear(GMouse *m, const point *pp) { static inline void CalibrationCrossClear(GMouse *m, const point *pp) {
gdispGFillArea(m->display, pp->x - CALIBRATION_CROSS_RADIUS, pp->y - CALIBRATION_CROSS_RADIUS, CALIBRATION_CROSS_RADIUS*2, CALIBRATION_CROSS_RADIUS*2, CALIBRATION_BACKGROUND); gdispGFillArea(m->display, pp->x - CALIBRATION_CROSS_RADIUS, pp->y - CALIBRATION_CROSS_RADIUS, CALIBRATION_CROSS_RADIUS*2+1, CALIBRATION_CROSS_RADIUS*2+1, CALIBRATION_BACKGROUND);
} }
static inline void CalibrationCalculate(GMouse *m, const point *cross, const point *points) { static inline void CalibrationCalculate(GMouse *m, const point *cross, const point *points) {