diff --git a/UI/properties-view.cpp b/UI/properties-view.cpp index b3ed72a84..39791d258 100644 --- a/UI/properties-view.cpp +++ b/UI/properties-view.cpp @@ -396,9 +396,9 @@ void OBSPropertiesView::AddFloat(obs_property_t *prop, QFormLayout *layout, const char *suffix = obs_property_float_suffix(prop); if (stepVal < 1.0) { - int decimals = (int)(log10(1.0 / stepVal) + 0.99); constexpr int sane_limit = 8; - decimals = std::min(decimals, sane_limit); + const int decimals = + std::min(log10(1.0 / stepVal) + 0.99, sane_limit); if (decimals > spin->decimals()) spin->setDecimals(decimals); } diff --git a/UI/window-basic-preview.cpp b/UI/window-basic-preview.cpp index fa211e71b..f00c1e954 100644 --- a/UI/window-basic-preview.cpp +++ b/UI/window-basic-preview.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include #include @@ -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;