UI: Use patterns that avoid std::min/max
New code is cleaner anyway.
This commit is contained in:
parent
d4bf7d4c23
commit
c93b040d0d
2 changed files with 10 additions and 7 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#include <QGuiApplication>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <graphics/vec4.h>
|
||||
|
|
@ -1049,10 +1048,14 @@ static bool FindItemsInBox(obs_scene_t *scene, obs_sceneitem_t *item,
|
|||
vec3 pos3;
|
||||
vec3 pos3_;
|
||||
|
||||
float x1 = std::min(data->startPos.x, data->pos.x);
|
||||
float x2 = std::max(data->startPos.x, data->pos.x);
|
||||
float y1 = std::min(data->startPos.y, data->pos.y);
|
||||
float y2 = std::max(data->startPos.y, data->pos.y);
|
||||
vec2 pos_min, pos_max;
|
||||
vec2_min(&pos_min, &data->startPos, &data->pos);
|
||||
vec2_max(&pos_max, &data->startPos, &data->pos);
|
||||
|
||||
const float x1 = pos_min.x;
|
||||
const float x2 = pos_max.x;
|
||||
const float y1 = pos_min.y;
|
||||
const float y2 = pos_max.y;
|
||||
|
||||
if (!SceneItemHasVideo(item))
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue