summaryrefslogtreecommitdiff
path: root/src/GsWidget.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-01-20 17:44:30 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-01-20 17:44:30 +0100
commite441405925865fe4d789040925aea20000d36f21 (patch)
tree204c8877b7d2c995f430fc0dd9694d5d6a3a3ed7 /src/GsWidget.cxx
parent87270613d16f082361537fbc1a80131a646756cf (diff)
add support for -z (zoom) option
Diffstat (limited to 'src/GsWidget.cxx')
-rw-r--r--src/GsWidget.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/GsWidget.cxx b/src/GsWidget.cxx
index dc134d2..1bb2e53 100644
--- a/src/GsWidget.cxx
+++ b/src/GsWidget.cxx
@@ -238,15 +238,15 @@ int GsWidget::zoom(int p) {
zoom_percent = p;
kill_gs();
-
- // Clear widget
- fl_begin_offscreen(offscreen);
- fl_color(FL_WHITE);
- fl_rectf(0, 0, w(), h());
- fl_end_offscreen();
- redraw();
-
+
if (offscreen) {
+ // Clear widget with current size
+ fl_begin_offscreen(offscreen);
+ fl_color(FL_WHITE);
+ fl_rectf(0, 0, w(), h());
+ fl_end_offscreen();
+ redraw();
+
fl_delete_offscreen(offscreen);
offscreen = 0;
}