comparison os2/dw.c @ 452:cf00d6e2b3cc

Optimizations to the layout engine on OS/2 and Windows, eliminated 3 MUL and 3 ADD operations per loop (on average). Also always return a valid HFONT from _acquire_font().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 23 Jun 2003 16:52:21 +0000
parents e81af9e60697
children 031d762fc8d6
comparison
equal deleted inserted replaced
451:538b529052e0 452:cf00d6e2b3cc
1034 thisbox->items[z].yratio = thisbox->yratio; 1034 thisbox->items[z].yratio = thisbox->yratio;
1035 } 1035 }
1036 1036
1037 if(thisbox->type == DW_VERT) 1037 if(thisbox->type == DW_VERT)
1038 { 1038 {
1039 if((thisbox->items[z].width + (thisbox->items[z].pad*2)) > uxmax) 1039 int itemwidth = thisbox->items[z].width + (thisbox->items[z].pad*2);
1040 uxmax = (thisbox->items[z].width + (thisbox->items[z].pad*2)); 1040
1041 if(itemwidth > uxmax)
1042 uxmax = itemwidth;
1041 if(thisbox->items[z].hsize != SIZEEXPAND) 1043 if(thisbox->items[z].hsize != SIZEEXPAND)
1042 { 1044 {
1043 if(((thisbox->items[z].pad*2) + thisbox->items[z].width) > upxmax) 1045 if(itemwidth > upxmax)
1044 upxmax = (thisbox->items[z].pad*2) + thisbox->items[z].width; 1046 upxmax = itemwidth;
1045 } 1047 }
1046 else 1048 else
1047 { 1049 {
1048 if(thisbox->items[z].pad*2 > upxmax) 1050 if(thisbox->items[z].pad*2 > upxmax)
1049 upxmax = thisbox->items[z].pad*2; 1051 upxmax = thisbox->items[z].pad*2;
1065 (*usedpadx) += thisbox->items[z].pad*2; 1067 (*usedpadx) += thisbox->items[z].pad*2;
1066 } 1068 }
1067 } 1069 }
1068 if(thisbox->type == DW_HORZ) 1070 if(thisbox->type == DW_HORZ)
1069 { 1071 {
1070 if((thisbox->items[z].height + (thisbox->items[z].pad*2)) > uymax) 1072 int itemheight = thisbox->items[z].height + (thisbox->items[z].pad*2);
1071 uymax = (thisbox->items[z].height + (thisbox->items[z].pad*2)); 1073
1074 if(itemheight > uymax)
1075 uymax = itemheight;
1072 if(thisbox->items[z].vsize != SIZEEXPAND) 1076 if(thisbox->items[z].vsize != SIZEEXPAND)
1073 { 1077 {
1074 if(((thisbox->items[z].pad*2) + thisbox->items[z].height) > upymax) 1078 if(itemheight > upymax)
1075 upymax = (thisbox->items[z].pad*2) + thisbox->items[z].height; 1079 upymax = itemheight;
1076 } 1080 }
1077 else 1081 else
1078 { 1082 {
1079 if(thisbox->items[z].pad*2 > upymax) 1083 if(thisbox->items[z].pad*2 > upymax)
1080 upymax = thisbox->items[z].pad*2; 1084 upymax = thisbox->items[z].pad*2;