DIRECTOR: don't draw outline shape when we get linesize < 0

This commit is contained in:
ysj1173886760 2021-07-04 18:58:08 +08:00 committed by Eugene Sandulenko
parent 8c792cd2a4
commit 8d270071cf
2 changed files with 7 additions and 3 deletions

View File

@ -156,9 +156,6 @@ void inkDrawPixel(int x, int y, int src, void *data) {
if (p->ms) {
// Get the pixel that macDrawPixel will give us, but store it to apply the
// ink later
// if we have lineSize <= 0, means we are not drawing anything. so we may return directly.
if (p->ms->lineSize <= 0)
return;
tmpDst = *dst;
(p->_wm->getDrawPixel())(x, y, src, p->ms->pd);
src = *dst;

View File

@ -214,6 +214,9 @@ void Window::inkBlitShape(DirectorPlotData *pd, Common::Rect &srcRect) {
Graphics::drawFilledRect(fillAreaRect, pd->ms->foreColor, g_director->getInkDrawPixel(), pd);
// fall through
case kOutlinedRectangleSprite:
// if we have lineSize <= 0, means we are not drawing anything. so we may return directly.
if (pd->ms->lineSize <= 0)
break;
pd->ms->pd = &plotStroke;
Graphics::drawRect(strokeRect, pd->ms->foreColor, g_director->getInkDrawPixel(), pd);
break;
@ -222,6 +225,8 @@ void Window::inkBlitShape(DirectorPlotData *pd, Common::Rect &srcRect) {
Graphics::drawRoundRect(fillAreaRect, 12, pd->ms->foreColor, true, g_director->getInkDrawPixel(), pd);
// fall through
case kOutlinedRoundedRectangleSprite:
if (pd->ms->lineSize <= 0)
break;
pd->ms->pd = &plotStroke;
Graphics::drawRoundRect(strokeRect, 12, pd->ms->foreColor, false, g_director->getInkDrawPixel(), pd);
break;
@ -230,6 +235,8 @@ void Window::inkBlitShape(DirectorPlotData *pd, Common::Rect &srcRect) {
Graphics::drawEllipse(fillAreaRect.left, fillAreaRect.top, fillAreaRect.right, fillAreaRect.bottom, pd->ms->foreColor, true, g_director->getInkDrawPixel(), pd);
// fall through
case kOutlinedOvalSprite:
if (pd->ms->lineSize <= 0)
break;
pd->ms->pd = &plotStroke;
Graphics::drawEllipse(strokeRect.left, strokeRect.top, strokeRect.right, strokeRect.bottom, pd->ms->foreColor, false, g_director->getInkDrawPixel(), pd);
break;