Refactor Layout Manager
This commit is contained in:
parent
e00dec67ba
commit
96b293d1b5
28 changed files with 408 additions and 123 deletions
|
|
@ -3,21 +3,21 @@
|
|||
|
||||
using namespace tp;
|
||||
|
||||
void FloatingLayout::pickRect() {
|
||||
void FloatingLayout::pickRect(bool vertical) {
|
||||
if (mIsFloating) {
|
||||
auto area = getArea();
|
||||
|
||||
if (mIsResizing) {
|
||||
mPointerCurrent.clamp(mMinSize, mMaxSize);
|
||||
|
||||
area.size = mPointerCurrent + mHandleSize / 2.f;
|
||||
area.size[vertical] = (mPointerCurrent + mHandleSize / 2.f)[vertical];
|
||||
|
||||
for (auto child : children()) {
|
||||
child->triggerWidgetUpdate("floating menu resized");
|
||||
}
|
||||
|
||||
} else if (mIsFloating) {
|
||||
area.pos += mPointerCurrent - mPointerStart;
|
||||
area.pos[vertical] += (mPointerCurrent - mPointerStart)[vertical];
|
||||
}
|
||||
|
||||
setArea(area);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue