Ensure Rasterizer::mWideBorder is initialized such that memory allocation in Rasterizer::Rasterize() doesn't go crazy. Also fix brainfart causing \xbord0\ybord<nonzero> to draw no border.

Originally committed to SVN as r2282.
This commit is contained in:
Niels Martin Hansen 2008-07-23 21:33:03 +00:00
parent 4e456b1abb
commit 582dd39cbd
1 changed files with 5 additions and 5 deletions

View File

@ -344,6 +344,7 @@ bool Rasterizer::ScanConvert()
mOutline.clear();
mWideOutline.clear();
mWideBorder = 0;
// Determine bounding box
@ -649,7 +650,9 @@ bool Rasterizer::CreateWidenedRegion(int rx, int ry)
if(rx < 0) rx = 0;
if(ry < 0) ry = 0;
if (ry > 0 && rx > 0)
mWideBorder = max(rx,ry);
if (ry > 0)
{
// Do a half circle.
// _OverlapRegion mirrors this so both halves are done.
@ -657,8 +660,7 @@ bool Rasterizer::CreateWidenedRegion(int rx, int ry)
{
int x = (int)(0.5 + sqrt(float(ry*ry - y*y)) * float(rx)/float(ry));
// If x=0 nothing will be drawn for this overlap, not sure why
_OverlapRegion(mWideOutline, mOutline, max(x,1), y);
_OverlapRegion(mWideOutline, mOutline, x, y);
}
}
else if (ry == 0 && rx > 0)
@ -668,8 +670,6 @@ bool Rasterizer::CreateWidenedRegion(int rx, int ry)
_OverlapRegion(mWideOutline, mOutline, rx, 0);
}
mWideBorder = max(rx,ry);
return true;
}