From: Alejandro G. Castro Date: Thu, 3 Jul 2008 09:36:27 +0000 (+0000) Subject: * src/hildon-pannable-area.c (hildon_pannable_area_size_allocate): Added conditions... X-Git-Tag: 2.1.66-1~666 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=ed38d95fafb6c220d6b38ff917512028efdb74ba;p=hildon * src/hildon-pannable-area.c (hildon_pannable_area_size_allocate): Added conditions to control when overshooting is bigger than the allocated space for the children, this avoids negative allocations. --- diff --git a/ChangeLog b/ChangeLog index 3c11f03..1878e6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-03 Alejandro G. Castro + + * src/hildon-pannable-area.c + (hildon_pannable_area_size_allocate): Added conditions to control + when overshooting is bigger than the allocated space for the + children, this avoids negative allocations. + 2008-07-02 Alberto Garcia * doc/hildon-docs.sgml diff --git a/src/hildon-pannable-area.c b/src/hildon-pannable-area.c index 7e3316e..ef601e1 100644 --- a/src/hildon-pannable-area.c +++ b/src/hildon-pannable-area.c @@ -1481,21 +1481,25 @@ hildon_pannable_area_size_allocate (GtkWidget * widget, hildon_pannable_area_refresh (HILDON_PANNABLE_AREA (widget)); - child_allocation.width -= (priv->vscroll ? priv->vscroll_rect.width : 0); - child_allocation.height -= (priv->hscroll ? priv->hscroll_rect.height : 0); + child_allocation.width = MAX (child_allocation.width - (priv->vscroll ? + priv->vscroll_rect.width : 0), + 0); + child_allocation.height = MAX (child_allocation.height - (priv->hscroll ? + priv->hscroll_rect.height : 0), + 0); if (priv->overshot_dist_y > 0) { child_allocation.y += priv->overshot_dist_y; - child_allocation.height -= priv->overshot_dist_y; + child_allocation.height = MAX (child_allocation.height - priv->overshot_dist_y, 0); } else if (priv->overshot_dist_y < 0) { - child_allocation.height += priv->overshot_dist_y; + child_allocation.height = MAX (child_allocation.height + priv->overshot_dist_y, 0); } if (priv->overshot_dist_x > 0) { child_allocation.x += priv->overshot_dist_x; - child_allocation.width -= priv->overshot_dist_x; + child_allocation.width = MAX (child_allocation.width - priv->overshot_dist_x, 0); } else if (priv->overshot_dist_x < 0) { - child_allocation.width += priv->overshot_dist_x; + child_allocation.width = MAX (child_allocation.width + priv->overshot_dist_x, 0); } if (bin->child)