diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-10 22:19:54 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-10 22:19:54 +0000 |
commit | 55f6a421cb5ba5feafceecfb70a8119038da9639 (patch) | |
tree | bbad04bca01ae364614fc4f33fda00df194a9ea2 /libs | |
parent | 0ea547b9515b5a3cc740697bb1f69da0367ec277 (diff) |
the real fix for fastmeter - the rect that should show the pixbuf didn't have its origin reset before computing the intersection with the expose rect
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2884 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/fastmeter.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc index ccc0a77606..1fd3fbb597 100644 --- a/libs/gtkmm2ext/fastmeter.cc +++ b/libs/gtkmm2ext/fastmeter.cc @@ -353,7 +353,12 @@ FastMeter::vertical_expose (GdkEventExpose* ev) GdkRectangle background; top_of_meter = (gint) floor (pixheight * current_level); + + /* reset the height & origin of the rect that needs to show the pixbuf + */ + pixrect.height = top_of_meter; + pixrect.y = pixheight - top_of_meter; background.x = 0; background.y = 0; @@ -365,13 +370,13 @@ FastMeter::vertical_expose (GdkEventExpose* ev) intersection.x, intersection.y, intersection.width, intersection.height); } - + if (gdk_rectangle_intersect (&pixrect, &ev->area, &intersection)) { // draw the part of the meter image that we need. the area we draw is bounded "in reverse" (top->bottom) get_window()->draw_pixbuf(get_style()->get_fg_gc(get_state()), pixbuf, - intersection.x, pixheight - top_of_meter, - intersection.x, pixheight - top_of_meter, - intersection.width, pixrect.height, + intersection.x, intersection.y, + intersection.x, intersection.y, + intersection.width, intersection.height, Gdk::RGB_DITHER_NONE, 0, 0); } |