@@ -169,23 +169,23 @@ static void
169
169
drawCross (modm::ColorGraphicDisplay& display, modm::glcd::Point center)
170
170
{
171
171
display.setColor (html::Red);
172
- display.drawLine (center.x - 15 , center.y , center.x - 2 , center.y );
173
- display.drawLine (center.x + 2 , center.y , center.x + 15 , center.y );
174
- display.drawLine (center.x , center.y - 15 , center.x , center.y - 2 );
175
- display.drawLine (center.x , center.y + 2 , center.x , center.y + 15 );
172
+ display.drawLine (center.x () - 15 , center.y () , center.x () - 2 , center.y () );
173
+ display.drawLine (center.x () + 2 , center.y () , center.x () + 15 , center.y () );
174
+ display.drawLine (center.x () , center.y () - 15 , center.x () , center.y () - 2 );
175
+ display.drawLine (center.x () , center.y () + 2 , center.x () , center.y () + 15 );
176
176
177
177
display.setColor (html::White);
178
- display.drawLine (center.x - 15 , center.y + 15 , center.x - 7 , center.y + 15 );
179
- display.drawLine (center.x - 15 , center.y + 7 , center.x - 15 , center.y + 15 );
178
+ display.drawLine (center.x () - 15 , center.y () + 15 , center.x () - 7 , center.y () + 15 );
179
+ display.drawLine (center.x () - 15 , center.y () + 7 , center.x () - 15 , center.y () + 15 );
180
180
181
- display.drawLine (center.x - 15 , center.y - 15 , center.x - 7 , center.y - 15 );
182
- display.drawLine (center.x - 15 , center.y - 7 , center.x - 15 , center.y - 15 );
181
+ display.drawLine (center.x () - 15 , center.y () - 15 , center.x () - 7 , center.y () - 15 );
182
+ display.drawLine (center.x () - 15 , center.y () - 7 , center.x () - 15 , center.y () - 15 );
183
183
184
- display.drawLine (center.x + 7 , center.y + 15 , center.x + 15 , center.y + 15 );
185
- display.drawLine (center.x + 15 , center.y + 7 , center.x + 15 , center.y + 15 );
184
+ display.drawLine (center.x () + 7 , center.y () + 15 , center.x () + 15 , center.y () + 15 );
185
+ display.drawLine (center.x () + 15 , center.y () + 7 , center.x () + 15 , center.y () + 15 );
186
186
187
- display.drawLine (center.x + 7 , center.y - 15 , center.x + 15 , center.y - 15 );
188
- display.drawLine (center.x + 15 , center.y - 15 , center.x + 15 , center.y - 7 );
187
+ display.drawLine (center.x () + 7 , center.y () - 15 , center.x () + 15 , center.y () - 15 );
188
+ display.drawLine (center.x () + 15 , center.y () - 15 , center.x () + 15 , center.y () - 7 );
189
189
}
190
190
191
191
static void
@@ -211,7 +211,7 @@ calibrateTouchscreen(modm::ColorGraphicDisplay& display, modm::glcd::Point *fixe
211
211
// wait until a valid sample can be taken
212
212
}
213
213
214
- MODM_LOG_DEBUG << " calibration point: (" << sample[i].x << " | " << sample[i].y << " )" << modm::endl;
214
+ MODM_LOG_DEBUG << " calibration point: (" << sample[i].x () << " | " << sample[i].y () << " )" << modm::endl;
215
215
}
216
216
217
217
touchscreen.calibrate (calibrationPoint, sample);
@@ -227,14 +227,14 @@ void
227
227
drawPoint (modm::GraphicDisplay& display, modm::glcd::Point point)
228
228
{
229
229
MODM_LOG_DEBUG << __PRETTY_FUNCTION__ << modm::endl;
230
- if (point.x < 0 || point.y < 0 ) {
230
+ if (point.x () < 0 || point.y () < 0 ) {
231
231
return ;
232
232
}
233
233
234
- display.setPixel (point.x , point.y );
235
- display.setPixel (point.x + 1 , point.y );
236
- display.setPixel (point.x , point.y + 1 );
237
- display.setPixel (point.x + 1 , point.y + 1 );
234
+ display.setPixel (point.x () , point.y () );
235
+ display.setPixel (point.x () + 1 , point.y () );
236
+ display.setPixel (point.x () , point.y () + 1 );
237
+ display.setPixel (point.x () + 1 , point.y () + 1 );
238
238
}
239
239
240
240
// ----------------------------------------------------------------------------
@@ -286,8 +286,8 @@ debounceTouch(modm::glcd::Point *out, modm::glcd::Point *old)
286
286
// translate point according to calibration
287
287
touchscreen.translate (&raw, &point);
288
288
289
- if (abs (point.x - old->x ) < TP_TOLERANCE &&
290
- abs (point.y - old->y ) < TP_TOLERANCE
289
+ if (abs (point.x () - old->x () ) < TP_TOLERANCE &&
290
+ abs (point.y () - old->y () ) < TP_TOLERANCE
291
291
)
292
292
{
293
293
// point is within area of last touch
@@ -321,8 +321,8 @@ touchUp(void* data)
321
321
modm::gui::InputEvent* ev = static_cast <modm::gui::InputEvent*>(data);
322
322
323
323
MODM_LOG_DEBUG << " asynchronous UP-event:" << modm::endl;
324
- MODM_LOG_DEBUG << " x: " << ev->coord .x << modm::endl;
325
- MODM_LOG_DEBUG << " y: " << ev->coord .y << modm::endl;
324
+ MODM_LOG_DEBUG << " x: " << ev->coord .x () << modm::endl;
325
+ MODM_LOG_DEBUG << " y: " << ev->coord .y () << modm::endl;
326
326
327
327
// queue UP-event as new input event
328
328
input_queue.push (ev);
@@ -351,8 +351,8 @@ gatherInput()
351
351
auto async_ev = new modm::gui::AsyncEvent (500 , &touchUp, (void *)(ev_up));
352
352
async_events.append (async_ev);
353
353
354
- MODM_LOG_DEBUG << " touch down x: " << point.x << modm::endl;
355
- MODM_LOG_DEBUG << " touch down y: " << point.y << modm::endl;
354
+ MODM_LOG_DEBUG << " touch down x: " << point.x () << modm::endl;
355
+ MODM_LOG_DEBUG << " touch down y: " << point.y () << modm::endl;
356
356
357
357
}
358
358
}
@@ -492,11 +492,11 @@ main()
492
492
/*
493
493
* display an arbitrary image
494
494
*/
495
- // if(pixPos.x < 0 || (pixPos.x + pix[0]) > tft.getWidth()){
496
- // pixDeltaPos.x *= -1;
495
+ // if(pixPos.x() < 0 || (pixPos.x() + pix[0]) > tft.getWidth()){
496
+ // pixDeltaPos.x() *= -1;
497
497
// }
498
- // if(pixPos.y < 0 || (pixPos.y + pix[1]) > tft.getHeight()){
499
- // pixDeltaPos.y *= -1;
498
+ // if(pixPos.y() < 0 || (pixPos.y() + pix[1]) > tft.getHeight()){
499
+ // pixDeltaPos.y() *= -1;
500
500
// }
501
501
// pixPos += pixDeltaPos;
502
502
// tft.drawImage(pixPos, pix);
0 commit comments