summaryrefslogtreecommitdiff
path: root/src/GsWidget.cxx
diff options
context:
space:
mode:
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;
}