From d7d711807d5cd3fdfbebe1c0ede7a9e6271524d4 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 14 Jul 2013 15:44:14 -0700 Subject: [PATCH] FL/Fl_Scalepack: Fix resize bug. --- FL/Fl_Scalepack.C | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/FL/Fl_Scalepack.C b/FL/Fl_Scalepack.C index 3979584..c253838 100644 --- a/FL/Fl_Scalepack.C +++ b/FL/Fl_Scalepack.C @@ -53,7 +53,24 @@ Fl_Scalepack::resize ( int X, int Y, int W, int H ) { /* Fl_Group's resize will change our child widget sizes, which interferes with our own resizing method. */ + long dx = X - x(); + long dy = Y - y(); + + bool r = W != w() || H != h(); + Fl_Widget::resize( X, Y, W, H ); + + Fl_Widget*const* a = array(); + + for (int i=children(); i--;) + { + Fl_Widget* o = *a++; + + o->position( o->x() + dx, o->y() + dy ); + } + + if ( r ) + redraw(); } void