diff 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
line wrap: on
line diff
--- a/os2/dw.c	Mon Jun 23 08:58:38 2003 +0000
+++ b/os2/dw.c	Mon Jun 23 16:52:21 2003 +0000
@@ -1036,12 +1036,14 @@
 
 		if(thisbox->type == DW_VERT)
 		{
-			if((thisbox->items[z].width + (thisbox->items[z].pad*2)) > uxmax)
-				uxmax = (thisbox->items[z].width + (thisbox->items[z].pad*2));
+			int itemwidth = thisbox->items[z].width + (thisbox->items[z].pad*2);
+
+			if(itemwidth > uxmax)
+				uxmax = itemwidth;
 			if(thisbox->items[z].hsize != SIZEEXPAND)
 			{
-				if(((thisbox->items[z].pad*2) + thisbox->items[z].width) > upxmax)
-					upxmax = (thisbox->items[z].pad*2) + thisbox->items[z].width;
+				if(itemwidth > upxmax)
+					upxmax = itemwidth;
 			}
 			else
 			{
@@ -1067,12 +1069,14 @@
 		}
 		if(thisbox->type == DW_HORZ)
 		{
-			if((thisbox->items[z].height + (thisbox->items[z].pad*2)) > uymax)
-				uymax = (thisbox->items[z].height + (thisbox->items[z].pad*2));
+			int itemheight = thisbox->items[z].height + (thisbox->items[z].pad*2);
+
+			if(itemheight > uymax)
+				uymax = itemheight;
 			if(thisbox->items[z].vsize != SIZEEXPAND)
 			{
-				if(((thisbox->items[z].pad*2) + thisbox->items[z].height) > upymax)
-					upymax = (thisbox->items[z].pad*2) + thisbox->items[z].height;
+				if(itemheight > upymax)
+					upymax = itemheight;
 			}
 			else
 			{