diff options
author | Paul Gilbert | 2019-01-02 14:21:49 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-01-02 14:23:40 -0800 |
commit | 3ed48e3de223259dd58f0c613c2d68d69848e5a2 (patch) | |
tree | 842ff37835be0081400a24e877b555b1d1a4037f /engines/glk/window_pair.cpp | |
parent | f1fdb0cd26b2645b7b012f5177f50bdaffcd10f9 (diff) | |
download | scummvm-rg350-3ed48e3de223259dd58f0c613c2d68d69848e5a2.tar.gz scummvm-rg350-3ed48e3de223259dd58f0c613c2d68d69848e5a2.tar.bz2 scummvm-rg350-3ed48e3de223259dd58f0c613c2d68d69848e5a2.zip |
GLK: FROTZ: Setting window positon & size, some property reading
Diffstat (limited to 'engines/glk/window_pair.cpp')
-rw-r--r-- | engines/glk/window_pair.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/engines/glk/window_pair.cpp b/engines/glk/window_pair.cpp index 6fdeb93635..c90f389eac 100644 --- a/engines/glk/window_pair.cpp +++ b/engines/glk/window_pair.cpp @@ -50,6 +50,28 @@ void PairWindow::rearrange(const Rect &box) { _bbox = box; + if (!_backward) { + ch1 = _child1; + ch2 = _child2; + } else { + ch1 = _child2; + ch2 = _child1; + } + + + if (_dir == winmethod_OnTop) { + // ch2 is on top of ch1 + ch1->rearrange(box1); + if (!ch2->_bbox.isEmpty() && !ch2->_bbox.contains(box)) { + // ch2 is outside new bounds, so clip it to the new dimensions + Rect subRect = ch2->_bbox; + subRect.clip(box); + ch2->rearrange(subRect); + } + + return; + } + if (_vertical) { min = _bbox.left; max = _bbox.right; @@ -113,14 +135,6 @@ void PairWindow::rearrange(const Rect &box) { box2.right = _bbox.right; } - if (!_backward) { - ch1 = _child1; - ch2 = _child2; - } else { - ch1 = _child2; - ch2 = _child1; - } - ch1->rearrange(box1); ch2->rearrange(box2); } |