From 044151cee3dc6a65ba21f93db331844d6c8f3974 Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Sun, 27 Apr 2008 22:40:27 +0000 Subject: Add methods to get width and height adjusted for any visible scrollbars. --- src/gui/scrollarea.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/scrollarea.cpp') diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index 255aa2d8..21f37510 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -296,3 +296,15 @@ void ScrollArea::drawHMarker(gcn::Graphics *graphics) static_cast(graphics)-> drawImageRect(dim.x, dim.y, dim.width, dim.height, vMarker); } + +int ScrollArea::getAdjustedWidth() const +{ + return ScrollArea::getDimension().width - + (mVBarVisible ? ScrollArea::getScrollbarWidth() : 0); +} + +int ScrollArea::getAdjustedHeight() const +{ + return ScrollArea::getDimension().height - + (mHBarVisible ? ScrollArea::getScrollbarWidth() : 0); +} -- cgit v1.2.3-70-g09d2