From d15d76976b6e57a9f421ab034c6f841051b962f3 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 27 Jul 2005 21:55:20 +0000 Subject: Committing merging opengl and sdl part 3 by Andrej --- src/gui/scrollarea.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gui/scrollarea.cpp') diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index c8524657..3350a252 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -180,10 +180,12 @@ void ScrollArea::draw(gcn::Graphics *graphics) { graphics->setColor(getBaseColor()); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->fillRectangle(gcn::Rectangle(getWidth() - mScrollbarWidth, getHeight() - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth)); +#endif } else { dynamic_cast(graphics)->fillRectangle(gcn::Rectangle(getWidth() - mScrollbarWidth, @@ -197,7 +199,9 @@ void ScrollArea::draw(gcn::Graphics *graphics) { gcn::Rectangle contdim = mContent->getDimension(); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->pushClipArea(getContentDimension()); +#endif } else { dynamic_cast(graphics)->pushClipArea(getContentDimension()); @@ -211,14 +215,18 @@ void ScrollArea::draw(gcn::Graphics *graphics) rec.width += 2 * mContent->getBorderSize(); rec.height += 2 * mContent->getBorderSize(); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->pushClipArea(rec); +#endif } else { dynamic_cast(graphics)->pushClipArea(rec); } mContent->drawBorder(graphics); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->popClipArea(); +#endif } else { dynamic_cast(graphics)->popClipArea(); @@ -226,15 +234,19 @@ void ScrollArea::draw(gcn::Graphics *graphics) } if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->pushClipArea(contdim); +#endif } else { dynamic_cast(graphics)->pushClipArea(contdim); } mContent->draw(graphics); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->popClipArea(); dynamic_cast(graphics)->popClipArea(); +#endif } else { dynamic_cast(graphics)->popClipArea(); @@ -330,7 +342,9 @@ void ScrollArea::drawVBar(gcn::Graphics *graphics) gcn::Rectangle dim = getVerticalBarDimension(); graphics->setColor(gcn::Color(0, 0, 0, 32)); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->fillRectangle(dim); +#endif } else { dynamic_cast(graphics)->fillRectangle(dim); @@ -343,7 +357,9 @@ void ScrollArea::drawHBar(gcn::Graphics *graphics) gcn::Rectangle dim = getHorizontalBarDimension(); graphics->setColor(gcn::Color(0, 0, 0, 32)); if (useOpenGL) { +#ifdef USE_OPENGL dynamic_cast(graphics)->fillRectangle(dim); +#endif } else { dynamic_cast(graphics)->fillRectangle(dim); -- cgit v1.2.3-70-g09d2