DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2032
Version: 1.1.9





Link: http://www.fltk.org/str.php?L2032
Version: 1.1.9
Index: src/Fl_Group.cxx
===================================================================
--- src/Fl_Group.cxx    (revision 6190)
+++ src/Fl_Group.cxx    (working copy)
@@ -420,8 +420,8 @@
 // sizes array stores the initial positions of widgets as
 // left,right,top,bottom quads.  The first quad is the group, the
 // second is the resizable (clipped to the group), and the
-// rest are the children.  This is a convienent order for the
-// algorithim.  If you change this be sure to fix Fl_Tile which
+// rest are the children.  This is a convenient order for the
+// algorithm.  If you change this be sure to fix Fl_Tile which
 // also uses this array!
 
 void Fl_Group::init_sizes() {
@@ -463,11 +463,18 @@
 
 void Fl_Group::resize(int X, int Y, int W, int H) {
 
-  if (!resizable() || W==w() && H==h() ) {
+  int dx = X-x();
+  int dy = Y-y();
+  int dw = W-w();
+  int dh = H-h();
+  
+  int *p = sizes(); // save initial sizes and positions
 
+  Fl_Widget::resize(X,Y,W,H); // make new xywh values visible for children
+
+  if (!resizable() || dw==0 && dh==0 ) {
+
     if (type() < FL_WINDOW) {
-      int dx = X-x();
-      int dy = Y-y();
       Fl_Widget*const* a = array();
       for (int i=children_; i--;) {
        Fl_Widget* o = *a++;
@@ -477,13 +484,11 @@
 
   } else if (children_) {
 
-    int *p = sizes();
-
     // get changes in size/position from the initial size:
-    int dx = X - p[0];
-    int dw = W - (p[1]-p[0]);
-    int dy = Y - p[2];
-    int dh = H - (p[3]-p[2]);
+    dx = X - p[0];
+    dw = W - (p[1]-p[0]);
+    dy = Y - p[2];
+    dh = H - (p[3]-p[2]);
     if (type() >= FL_WINDOW) dx = dy = 0;
     p += 4;
 
@@ -528,8 +533,6 @@
       o->resize(XX+dx, YY+dy, R-XX, B-YY);
     }
   }
-
-  Fl_Widget::resize(X,Y,W,H);
 }
 
 void Fl_Group::draw_children() {
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to