Fix ellipse plotter, adhere to sounder invariants this time.

This commit is contained in:
elasota
2020-01-21 00:09:38 -05:00
parent f5b0ef3698
commit 5e3e666765
2 changed files with 23 additions and 4 deletions

View File

@@ -1014,9 +1014,15 @@ void DrawSurface::SetSystemFont(int size, int variationFlags)
void DrawSurface::FillEllipse(const Rect &rect)
{
if (!rect.IsValid())
if (!rect.IsValid() || rect.Width() < 1 || rect.Height() < 1)
return;
if (rect.Width() <= 2 || rect.Height() <= 2)
{
FillRect(rect);
return;
}
PortabilityLayer::ScanlineMask *mask = PortabilityLayer::ScanlineMaskConverter::CompileEllipse(PortabilityLayer::Rect2i(rect.top, rect.left, rect.bottom, rect.right));
if (mask)
{