layersurface: dont rollover on size_t (#7451)

unneded rollover on size_t if force equals -1
This commit is contained in:
Tom Englund 2024-08-21 23:05:03 +02:00 committed by GitHub
parent 8162fae377
commit cae937c51b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -432,8 +432,8 @@ void CLayerSurface::startAnimation(bool in, bool instant) {
PMONITOR->vecPosition + Vector2D{PMONITOR->vecSize.x, PMONITOR->vecSize.y / 2},
};
float closest = std::numeric_limits<float>::max();
size_t leader = force;
float closest = std::numeric_limits<float>::max();
int leader = force;
if (leader == -1) {
for (size_t i = 0; i < 4; ++i) {
float dist = MIDDLE.distance(edgePoints[i]);