2
0
Mark Sibly 9 жил өмнө
parent
commit
d6739340f3

+ 1 - 1
modules/std/graphics/pixmap.monkey2

@@ -26,7 +26,7 @@ Class Pixmap
 	Method New( width:Int,height:Int,format:PixelFormat=PixelFormat.RGBA32 )
 
 		Local depth:=PixelFormatDepth( format )
-		Local pitch:=depth * height
+		Local pitch:=width*depth
 		Local data:=Cast<UByte Ptr>( libc.malloc( width*height*pitch ) )
 		
 		_width=width

+ 1 - 1
modules/std/graphics/pixmaploader.monkey2

@@ -64,7 +64,7 @@ Function LoadPixmap:Pixmap( path:String,format:PixelFormat )
 		End
 	End
 	
-	Return New Pixmap( x,y,format,data,PixelFormatDepth( format )*y,Lambda( data:UByte Ptr )
+	Return New Pixmap( x,y,format,data,x*PixelFormatDepth( format ),Lambda( data:UByte Ptr )
 		stbi_image_free( data )
 	End )
 End