c++: Turn (Logical|Physical)(Size|Position)` into structs

They used to declared by `using` before, so they were too easy to
convert into.
This commit is contained in:
Tobias Hunger 2022-09-13 11:24:42 +02:00 committed by Tobias Hunger
parent 0b29727aa5
commit e14fae45cd
3 changed files with 30 additions and 7 deletions

View file

@ -29,8 +29,16 @@ using Size2D = Size<T>;
}
/// A size given in logical pixels
using LogicalSize = Size<float>;
struct LogicalSize : public Size<float>
{
/// Explicitly convert a Size<float> to a LogicalSize
explicit LogicalSize(const Size<float> s) : Size<float>(s) {};
};
/// A size given in physical pixels.
using PhysicalSize = Size<uint32_t>;
struct PhysicalSize : public Size<uint32_t>
{
/// Explicitly convert a Size<uint32_t> to a LogicalSize
explicit PhysicalSize(const Size<uint32_t> s) : Size<uint32_t>(s) {};
};
}