comparison 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
comparison
equal deleted inserted replaced
46:30d091bc7899 47:997e9ed670ef
836 } 836 }
837 } 837 }
838 838
839 (*depth)++; 839 (*depth)++;
840 840
841 /*tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmp->upx) )/((float)(tmp->minwidth-tmp->upx));
842 tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmp->upy))/((float)(tmp->minheight-tmp->upy));*/
843
844 #ifdef DWDEBUG 841 #ifdef DWDEBUG
845 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", 842 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",
846 *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); 843 *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);
847 reopen(); 844 reopen();
848 #endif 845 #endif
960 if(thisbox) 957 if(thisbox)
961 { 958 {
962 int usedx = 0, usedy = 0, depth = 0, usedpadx = 0, usedpady = 0; 959 int usedx = 0, usedy = 0, depth = 0, usedpadx = 0, usedpady = 0;
963 960
964 _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady); 961 _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady);
962
963 if(usedx-usedpadx == 0 || usedy-usedpady == 0)
964 return;
965 965
966 thisbox->xratio = ((float)(x-usedpadx))/((float)(usedx-usedpadx)); 966 thisbox->xratio = ((float)(x-usedpadx))/((float)(usedx-usedpadx));
967 thisbox->yratio = ((float)(y-usedpady))/((float)(usedy-usedpady)); 967 thisbox->yratio = ((float)(y-usedpady))/((float)(usedy-usedpady));
968 968
969 #ifdef DWDEBUG 969 #ifdef DWDEBUG