summaryrefslogtreecommitdiff
path: root/util/epist/window.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-08-07 16:27:27 +0000
committerDana Jansens <danakj@orodu.net>2002-08-07 16:27:27 +0000
commit90ee16fc8664f38683edf3b2eb4dd376a572f4ce (patch)
treea8fcf766091afc8817cd186104d8b322d44bdb19 /util/epist/window.cc
parentd8967bd534ff10a234fed17059fb92d985be9176 (diff)
better support for relative resizing
Diffstat (limited to 'util/epist/window.cc')
-rw-r--r--util/epist/window.cc28
1 files changed, 6 insertions, 22 deletions
diff --git a/util/epist/window.cc b/util/epist/window.cc
index c8cdf012..31787e6d 100644
--- a/util/epist/window.cc
+++ b/util/epist/window.cc
@@ -336,34 +336,18 @@ void XWindow::move(int x, int y) const {
}
-void XWindow::resize(int dwidth, int dheight) const {
+void XWindow::resizeRel(int dwidth, int dheight) const {
// resize in increments if requested by the window
-
- unsigned int wdest = _rect.width() + (dwidth * _inc_x) /
- _inc_x * _inc_x + _base_x;
- unsigned int hdest = _rect.height() + (dheight * _inc_y) /
- _inc_y * _inc_y + _base_y;
-
- if (width > wdest) {
- while (width > wdest)
- wdest += _inc_x;
- } else {
- while (width < wdest)
- wdest -= _inc_x;
- }
- if (height > hdest) {
- while (height > hdest)
- hdest += _inc_y;
- } else {
- while (height < hdest)
- hdest -= _inc_y;
- }
+ unsigned int width = _rect.width(), height = _rect.height();
+ unsigned int wdest = width + (dwidth * _inc_x) / _inc_x * _inc_x + _base_x;
+ unsigned int hdest = height + (dheight * _inc_y) / _inc_y * _inc_y + _base_y;
+
XResizeWindow(_epist->getXDisplay(), _window, wdest, hdest);
}
-void XWindow::resize(unsigned int width, unsigned int height) const {
+void XWindow::resizeAbs(unsigned int width, unsigned int height) const {
// resize in increments if requested by the window
unsigned int wdest = width / _inc_x * _inc_x + _base_x;