Mercurial > dwindows
diff win/dw.c @ 47:997e9ed670ef
Fixes for box alignment problem on OS/2, crash in dw_bitmap_new() on unix
with certain versions of imlib. And other various code cleanups. Also
initial code for eventual conversion to gdk-pixbuf on unix from imlib.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 02 Nov 2001 10:31:29 +0000 |
parents | 30d091bc7899 |
children | 16eac0f8b45f |
line wrap: on
line diff
--- a/win/dw.c Tue Oct 30 10:49:09 2001 +0000 +++ b/win/dw.c Fri Nov 02 10:31:29 2001 +0000 @@ -838,9 +838,6 @@ (*depth)++; - /*tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmp->upx) )/((float)(tmp->minwidth-tmp->upx)); - tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmp->upy))/((float)(tmp->minheight-tmp->upy));*/ - #ifdef DWDEBUG fprintf(f, "2- Resize Box depth %d\r\nx = %d, y = %d, usedx = %d, usedy = %d, usedpadx = %d, usedpady = %d xratio = %f, yratio = %f,\r\nupx = %d, upy = %d, width = %d, height = %d, minwidth = %d, minheight = %d, box xratio = %f, box yratio = %f\r\n\r\n", *depth, x, y, *usedx, *usedy, *usedpadx, *usedpady, tmp->xratio, tmp->yratio, tmp->upx, tmp->upy, thisbox->items[z].width, thisbox->items[z].height, tmp->minwidth, tmp->minheight, thisbox->xratio, thisbox->yratio); @@ -963,6 +960,9 @@ _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady); + if(usedx-usedpadx == 0 || usedy-usedpady == 0) + return; + thisbox->xratio = ((float)(x-usedpadx))/((float)(usedx-usedpadx)); thisbox->yratio = ((float)(y-usedpady))/((float)(usedy-usedpady));