mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
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:
parent
0b29727aa5
commit
e14fae45cd
3 changed files with 30 additions and 7 deletions
|
@ -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) {};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue