42Bastian schrieb:
> Hi
> I noticed a strange behavior when using left resize handle on windows
> with a minimum size: As soon as the size gets smaller, the window is
> moved to the right, because the x value is not held fix.
>
> A little modification in AG_WindowSetGeometryRect() fixes this:
>
> - if (nw < wMin) { nw = wMin; }
> + if (nw < wMin) {
> +     if ( ox < r.x ) { r.x -= wMin - nw; }
> +     nw = wMin;
> +}

Sorry, I did not post every modification, needed because r.x could be
-1, here now the full modified code:

        if ( r.x == -1 ) r.x = WIDGET(win)->x;
        if ( r.y == -1 ) r.y = WIDGET(win)->y;

        if (win->flags & AG_WINDOW_MINSIZEPCT) {
                wMin = win->minPct*win->wReq/100;
                hMin = win->minPct*win->hReq/100;
        } else {
                wMin = win->wMin;
                hMin = win->hMin;
        }

        if (nw < wMin) {
                if ( ox < r.x ) { r.x -= wMin - nw; }
                nw = wMin;
        }
        if (nh < hMin) { nh = hMin; }

        /* Limit the window to the view boundaries. */
        aWin.x = r.x;
        aWin.y = r.y;

Cheers,

-- 
42Bastian
------------------
Parts of this email are written with invisible ink.

Note: SPAM-only account, direct mail to b...@...

_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to