diff libvo/vo_macosx.m @ 25424:cf72b0793c67

Use NSMakeRect and NSRect in correct way: The third parameter is width, the fouth parameter is height.
author ulion
date Tue, 18 Dec 2007 16:37:36 +0000
parents 875d77cb7bbc
children 8dfc8a3b4152
line wrap: on
line diff
--- a/libvo/vo_macosx.m	Tue Dec 18 14:58:14 2007 +0000
+++ b/libvo/vo_macosx.m	Tue Dec 18 16:37:36 2007 +0000
@@ -693,12 +693,12 @@
 		if((d_height*aspectX)>(frame.size.height))
 		{
 			padding = (frame.size.width - d_width*aspectY)/2;
-			textureFrame = NSMakeRect(padding, 0, d_width*aspectY+padding, d_height*aspectY);
+			textureFrame = NSMakeRect(padding, 0, d_width*aspectY, d_height*aspectY);
 		}
 		else
 		{
 			padding = ((frame.size.height) - d_height*aspectX)/2;
-			textureFrame = NSMakeRect(0, padding, d_width*aspectX, d_height*aspectX+padding);
+			textureFrame = NSMakeRect(0, padding, d_width*aspectX, d_height*aspectX);
 		}
 	}
 	else
@@ -723,9 +723,9 @@
 	glColor3f(1,1,1);
 	glBegin(GL_QUADS);
 	glTexCoord2f(upperLeft[0], upperLeft[1]); glVertex2i(	textureFrame.origin.x-(vo_panscan_x >> 1), textureFrame.origin.y-(vo_panscan_y >> 1));
-	glTexCoord2f(lowerLeft[0], lowerLeft[1]); glVertex2i(	textureFrame.origin.x-(vo_panscan_x >> 1), textureFrame.size.height+(vo_panscan_y >> 1));
-	glTexCoord2f(lowerRight[0], lowerRight[1]); glVertex2i(	textureFrame.size.width+(vo_panscan_x >> 1), textureFrame.size.height+(vo_panscan_y >> 1));
-	glTexCoord2f(upperRight[0], upperRight[1]); glVertex2i(	textureFrame.size.width+(vo_panscan_x >> 1), textureFrame.origin.y-(vo_panscan_y >> 1));
+	glTexCoord2f(lowerLeft[0], lowerLeft[1]); glVertex2i(textureFrame.origin.x-(vo_panscan_x >> 1), NSMaxY(textureFrame)+(vo_panscan_y >> 1));
+	glTexCoord2f(lowerRight[0], lowerRight[1]); glVertex2i(NSMaxX(textureFrame)+(vo_panscan_x >> 1), NSMaxY(textureFrame)+(vo_panscan_y >> 1));
+	glTexCoord2f(upperRight[0], upperRight[1]); glVertex2i(NSMaxX(textureFrame)+(vo_panscan_x >> 1), textureFrame.origin.y-(vo_panscan_y >> 1));
 	glEnd();
 	glDisable(CVOpenGLTextureGetTarget(texture));