Skip to content

Commit

Permalink
Fix error in QSize to our Size conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Dec 3, 2023
1 parent b56c923 commit 29779b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions YUViewLib/src/common/Typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ template <typename T> using vector4d = std::vector<vector3d<T>>;
template <typename T, size_t N> using array = std::array<T, N>;
template <typename T, size_t N1, size_t N2> using array2d = std::array<std::array<T, N2>, N1>;


template <typename T> int indexInVec(const std::vector<T> &vec, const T &item)
{
auto it = std::find(vec.begin(), vec.end(), item);
Expand Down Expand Up @@ -265,8 +264,9 @@ struct Size
{
constexpr Size(unsigned width, unsigned height) : width(width), height(height) {}
constexpr Size(int width, int height)
: width(static_cast<unsigned>(width)), height(static_cast<unsigned>(height))
{
this->width = (width < 0) ? 0 : static_cast<unsigned>(width);
this->height = (height < 0) ? 0 : static_cast<unsigned>(height);
}
constexpr Size() = default;

Expand Down

0 comments on commit 29779b7

Please sign in to comment.