* Fix scanline calculation

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@416 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2008-04-12 10:54:05 +00:00
parent b92338853e
commit 2fc903ef44

View File

@ -4491,8 +4491,11 @@ function CalculateScanline(Bits: Pointer; Width, Height, Row: Integer): Pointer;
// Helper function to calculate the start address for the given row.
begin
//todo: Height is always > 0 in LCL
{
if Height > 0 then // bottom-up DIB
Row := Height - Row - 1;
}
// Return DWORD aligned address of the requested scanline.
PtrInt(Result) := PtrInt(Bits) + Row * ((Width * 32 + 31) and not 31) div 8;
end;