rebrand and flip rortatoin
This commit is contained in:
@@ -101,8 +101,13 @@ Point mappedPoint() {
|
||||
long mx = map((long)raw.x, calXmin, calXmax, MARGIN_PX, Config::SCREEN_WIDTH - MARGIN_PX);
|
||||
long my = map((long)raw.y, calYmin, calYmax, MARGIN_PX, Config::SCREEN_HEIGHT - MARGIN_PX);
|
||||
|
||||
out.x = clampi((int16_t)mx, 0, Config::SCREEN_WIDTH - 1);
|
||||
out.x = clampi((int16_t)mx, 0, Config::SCREEN_WIDTH - 1);
|
||||
out.y = clampi((int16_t)my, 0, Config::SCREEN_HEIGHT - 1);
|
||||
|
||||
if (Config::DISPLAY_ROTATION == 2) {
|
||||
out.x = Config::SCREEN_WIDTH - 1 - out.x;
|
||||
out.y = Config::SCREEN_HEIGHT - 1 - out.y;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user