comparison win/dw.c @ 454:f1f188c678f3

Eliminate unnecessary and also erroneous code segment from the resize code that was causing incorrect calculations of the ratio that is opposite the box direction.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 23 Jun 2003 17:24:54 +0000
parents 031d762fc8d6
children dd04a4d781f8
comparison
equal deleted inserted replaced
453:031d762fc8d6 454:f1f188c678f3
931 } 931 }
932 } 932 }
933 933
934 if(pass > 1 && *depth > 0) 934 if(pass > 1 && *depth > 0)
935 { 935 {
936 if(thisbox->type == DW_VERT) 936 if(thisbox->minwidth-thisbox->upx == 0)
937 { 937 thisbox->items[z].xratio = 1.0;
938 if((thisbox->minwidth-((thisbox->items[z].pad*2)+(thisbox->parentpad*2))) == 0)
939 thisbox->items[z].xratio = 1.0;
940 else
941 thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-((thisbox->items[z].pad*2)+(thisbox->parentpad*2))))/((float)(thisbox->minwidth-((thisbox->items[z].pad*2)+(thisbox->parentpad*2))));
942 }
943 else 938 else
944 { 939 thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-thisbox->upx))/((float)(thisbox->minwidth-thisbox->upx));
945 if(thisbox->minwidth-thisbox->upx == 0) 940 if(thisbox->minheight-thisbox->upy == 0)
946 thisbox->items[z].xratio = 1.0; 941 thisbox->items[z].yratio = 1.0;
947 else
948 thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-thisbox->upx))/((float)(thisbox->minwidth-thisbox->upx));
949 }
950
951 if(thisbox->type == DW_HORZ)
952 {
953 if((thisbox->minheight-((thisbox->items[z].pad*2)+(thisbox->parentpad*2))) == 0)
954 thisbox->items[z].yratio = 1.0;
955 else
956 thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-((thisbox->items[z].pad*2)+(thisbox->parentpad*2))))/((float)(thisbox->minheight-((thisbox->items[z].pad*2)+(thisbox->parentpad*2))));
957 }
958 else 942 else
959 { 943 thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-thisbox->upy))/((float)(thisbox->minheight-thisbox->upy));
960 if(thisbox->minheight-thisbox->upy == 0)
961 thisbox->items[z].yratio = 1.0;
962 else
963 thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-thisbox->upy))/((float)(thisbox->minheight-thisbox->upy));
964 }
965 944
966 if(thisbox->items[z].type == TYPEBOX) 945 if(thisbox->items[z].type == TYPEBOX)
967 { 946 {
968 Box *tmp = (Box *)GetWindowLongPtr(thisbox->items[z].hwnd, GWLP_USERDATA); 947 Box *tmp = (Box *)GetWindowLongPtr(thisbox->items[z].hwnd, GWLP_USERDATA);
969 948