зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1837832 - Change parameter types from T to Coord where appropriate in the remainder of the BasePoint interface r=botond
Differential Revision: https://phabricator.services.mozilla.com/D180814
This commit is contained in:
Родитель
3f12a1ea57
Коммит
f3e0985c12
|
@ -37,11 +37,11 @@ struct BasePoint {
|
|||
MOZ_ALWAYS_INLINE Coord X() const { return x; }
|
||||
MOZ_ALWAYS_INLINE Coord Y() const { return y; }
|
||||
|
||||
void MoveTo(T aX, T aY) {
|
||||
void MoveTo(Coord aX, Coord aY) {
|
||||
x = aX;
|
||||
y = aY;
|
||||
}
|
||||
void MoveBy(T aDx, T aDy) {
|
||||
void MoveBy(Coord aDx, Coord aDy) {
|
||||
x += aDx;
|
||||
y += aDy;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ struct BasePoint {
|
|||
return true;
|
||||
}
|
||||
|
||||
void Clamp(T aMaxAbsValue) {
|
||||
void Clamp(Coord aMaxAbsValue) {
|
||||
x = std::max(std::min(x, aMaxAbsValue), -aMaxAbsValue);
|
||||
y = std::max(std::min(y, aMaxAbsValue), -aMaxAbsValue);
|
||||
}
|
||||
|
|
|
@ -138,14 +138,13 @@ MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent)
|
|||
}
|
||||
|
||||
void MultiTouchInput::Translate(const ScreenPoint& aTranslation) {
|
||||
const int32_t xTranslation = (int32_t)(aTranslation.x + 0.5f);
|
||||
const int32_t yTranslation = (int32_t)(aTranslation.y + 0.5f);
|
||||
ScreenIntPoint translation = RoundedToInt(aTranslation);
|
||||
|
||||
for (auto& touchData : mTouches) {
|
||||
for (auto& historicalData : touchData.mHistoricalData) {
|
||||
historicalData.mScreenPoint.MoveBy(xTranslation, yTranslation);
|
||||
historicalData.mScreenPoint.MoveBy(translation.x, translation.y);
|
||||
}
|
||||
touchData.mScreenPoint.MoveBy(xTranslation, yTranslation);
|
||||
touchData.mScreenPoint.MoveBy(translation.x, translation.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче