Added helpful function to convert padding into top-left point.
This commit is contained in:
parent
1587f9f1b9
commit
edfcac751d
1 changed files with 16 additions and 0 deletions
16
ui/rect.h
16
ui/rect.h
|
|
@ -39,6 +39,22 @@ namespace sum {
|
|||
}
|
||||
|
||||
} // namespace sum
|
||||
|
||||
namespace pos {
|
||||
|
||||
/*
|
||||
Top-left.
|
||||
rect::m::pos::tl(mypadding);
|
||||
*/
|
||||
[[nodiscard]] inline QPoint tl(const QMargins &margins) {
|
||||
return { margins.left(), margins.top() };
|
||||
}
|
||||
|
||||
[[nodiscard]] inline QPointF tl(const QMarginsF &margins) {
|
||||
return { margins.left(), margins.top() };
|
||||
}
|
||||
|
||||
} // namespace pos
|
||||
} // namespace m
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue