From 90ee16fc8664f38683edf3b2eb4dd376a572f4ce Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 7 Aug 2002 16:27:27 +0000 Subject: better support for relative resizing --- util/epist/window.cc | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'util/epist/window.cc') 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; -- cgit v1.2.3