aboutsummaryrefslogtreecommitdiff
path: root/dw/fltkviewbase.hh
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-09-01 22:02:28 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-09-01 22:02:28 +0200
commit1eeb793701bc01670d22454f81ad5312bf8fa013 (patch)
tree99c0f82436aeb4158ac05ffc153fca2de7fd4a85 /dw/fltkviewbase.hh
parent652a25919942438b6145dc9db672ad6c6b477306 (diff)
further reduce size of rectangles before drawing
Make currently exposed area available in FltkViewBase and use it to clip rectangles to the required size before drawing them. We can use the same mechanism to limit drawImage() calls instead of doing it in dw/image.cc as currently done.
Diffstat (limited to 'dw/fltkviewbase.hh')
-rw-r--r--dw/fltkviewbase.hh19
1 files changed, 11 insertions, 8 deletions
diff --git a/dw/fltkviewbase.hh b/dw/fltkviewbase.hh
index c502d2f7..fb3f2fe1 100644
--- a/dw/fltkviewbase.hh
+++ b/dw/fltkviewbase.hh
@@ -20,20 +20,23 @@ private:
int bgColor;
core::Region drawRegion;
+ ::fltk::Rectangle *exposeArea;
static ::fltk::Image *backBuffer;
static bool backBufferInUse;
void draw (const core::Rectangle *rect, DrawType type);
void drawChildWidgets ();
inline void clipPoint (int *x, int *y) {
- if (*x < 0)
- *x = 0;
- if (*x > w ())
- *x = w ();
- if (*y < 0)
- *y = 0;
- if (*y > h ())
- *y = h ();
+ if (exposeArea) {
+ if (*x < exposeArea->x ())
+ *x = exposeArea->x ();
+ if (*x > exposeArea->r ())
+ *x = exposeArea->r ();
+ if (*y < exposeArea->y ())
+ *y = exposeArea->y ();
+ if (*y > exposeArea->b ())
+ *y = exposeArea->b ();
+ }
}
protected: