Fix Win32 repeat key test

This commit is contained in:
Jack Andersen
2016-01-01 18:15:41 -10:00
parent 4d7e9656f1
commit bcfff2bf7f
2 changed files with 24 additions and 9 deletions

View File

@@ -3,6 +3,10 @@
#include "System.hpp"
#include <memory>
#include <algorithm>
#undef min
#undef max
namespace boo
{
@@ -75,9 +79,22 @@ struct SScrollDelta
bool isAccelerated = false; /* System performs acceleration computation */
SScrollDelta operator+(const SScrollDelta& other)
{return {{delta[0] + other.delta[0], delta[1] + other.delta[1]}, isFine || other.isFine};}
{
SScrollDelta ret;
ret.delta[0] = delta[0] + other.delta[0];
ret.delta[1] = delta[1] + other.delta[1];
ret.isFine = isFine || other.isFine;
ret.isAccelerated = isAccelerated || other.isAccelerated;
return ret;
}
SScrollDelta& operator+=(const SScrollDelta& other)
{delta[0] += other.delta[0]; delta[1] += other.delta[1]; isFine |= other.isFine; return *this;}
{
delta[0] += other.delta[0];
delta[1] += other.delta[1];
isFine |= other.isFine;
isAccelerated |= other.isAccelerated;
return *this;
}
void zeroOut() {delta[0] = 0.0; delta[1] = 0.0;}
};