Add some paranoid checks around touch IDs that probably won't help #9647

Also adds LunaMoo to credits list.
This commit is contained in:
Henrik Rydgard committed 2017-04-30 08:57:44 +02:00
1 parent 4f6b9c1fd2
commit 9a1cd5a5e8
6 files changed
+9 -6

No files matched your search

+1
View File
@@ -644,6 +644,7 @@ void CreditsScreen::render() {
"Coldbird",
"Kyhel",
"xebra",
"LunaMoo",
"",
cr->T("specialthanks", "Special thanks to:"),
"Maxim for his amazing Atrac3+ decoder work",
+1 -1
View File
@@ -197,7 +197,7 @@ static int ScreenDPI() {
HDC screenDC = GetDC(nullptr);
int dotsPerInch = GetDeviceCaps(screenDC, LOGPIXELSY);
ReleaseDC(nullptr, screenDC);
return dotsPerInch;
return dotsPerInch ? dotsPerInch : 96;
}
#endif
#endif
Submodule
+1
Submodule ext/freetype added at 3e79254ae7.
+5 -2
View File
@@ -10,6 +10,9 @@
const float estimatedInertiaDamping = 0.75f;
TouchInput GestureDetector::Update(const TouchInput &touch, const Bounds &bounds) {
if (touch.id < 0 || touch.id >= MAX_PTRS) {
return touch;
}
// Mouse / 1-finger-touch control.
Pointer &p = pointers[touch.id];
if ((touch.flags & TOUCH_DOWN) && bounds.Contains(touch.x, touch.y)) {
@@ -79,13 +82,13 @@ void GestureDetector::UpdateFrame() {
}
bool GestureDetector::IsGestureActive(Gesture gesture, int touchId) const {
if (touchId < 0)
if (touchId < 0 || touchId >= MAX_PTRS)
return false;
return (pointers[touchId].active & gesture) != 0;
}
bool GestureDetector::GetGestureInfo(Gesture gesture, int touchId, float info[4]) const {
if (touchId < 0)
if (touchId < 0 || touchId >= MAX_PTRS)
return false;
memset(info, 0, sizeof(float) * 4);
if (!(pointers[touchId].active & gesture)) {
-2
View File
@@ -438,8 +438,6 @@ protected:
// Outputs of layout. X/Y are absolute screen coordinates, hierarchy is "gone" here.
Bounds bounds_;
std::unique_ptr<Matrix4x4> transform_;
private:
bool *enabledPtr_;
bool enabled_;
+1 -1
View File
@@ -890,7 +890,7 @@ float ScrollView::ClampedScrollPos(float pos) {
Gesture gesture = orientation_ == ORIENT_VERTICAL ? GESTURE_DRAG_VERTICAL : GESTURE_DRAG_HORIZONTAL;
if (scrollTouchId_ != -1 && gesture_.IsGestureActive(gesture, scrollTouchId_)) {
if (scrollTouchId_ >= 0 && gesture_.IsGestureActive(gesture, scrollTouchId_) && bounds_.h > 0) {
float maxPull = bounds_.h * 0.1f;
if (pos < 0.0f) {
float dist = std::min(-pos * (1.0f / bounds_.h), 1.0f);