Kaydet (Commit) 3d91d54c authored tarafından Chris Sherlock's avatar Chris Sherlock

VCL move DrawCheckered from outdev.cxx to rect.cxx

Change-Id: I55cbab29e4e0d772e593f39ba48a3a2dffbce382
üst db45e761
...@@ -985,28 +985,4 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, ...@@ -985,28 +985,4 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
return bDrawn; return bDrawn;
} }
void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize, sal_uInt32 nLen, Color aStart, Color aEnd)
{
const sal_uInt32 nMaxX(rPos.X() + rSize.Width());
const sal_uInt32 nMaxY(rPos.Y() + rSize.Height());
Push(PUSH_LINECOLOR|PUSH_FILLCOLOR);
SetLineColor();
for(sal_uInt32 x(0), nX(rPos.X()); nX < nMaxX; x++, nX += nLen)
{
const sal_uInt32 nRight(std::min(nMaxX, nX + nLen));
for(sal_uInt32 y(0), nY(rPos.Y()); nY < nMaxY; y++, nY += nLen)
{
const sal_uInt32 nBottom(std::min(nMaxY, nY + nLen));
SetFillColor((x & 0x0001) ^ (y & 0x0001) ? aStart : aEnd);
DrawRect(Rectangle(nX, nY, nRight, nBottom));
}
}
Pop();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -121,6 +121,30 @@ void OutputDevice::DrawRect( const Rectangle& rRect, ...@@ -121,6 +121,30 @@ void OutputDevice::DrawRect( const Rectangle& rRect,
mpAlphaVDev->DrawRect( rRect, nHorzRound, nVertRound ); mpAlphaVDev->DrawRect( rRect, nHorzRound, nVertRound );
} }
void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize, sal_uInt32 nLen, Color aStart, Color aEnd)
{
const sal_uInt32 nMaxX(rPos.X() + rSize.Width());
const sal_uInt32 nMaxY(rPos.Y() + rSize.Height());
Push(PUSH_LINECOLOR|PUSH_FILLCOLOR);
SetLineColor();
for(sal_uInt32 x(0), nX(rPos.X()); nX < nMaxX; x++, nX += nLen)
{
const sal_uInt32 nRight(std::min(nMaxX, nX + nLen));
for(sal_uInt32 y(0), nY(rPos.Y()); nY < nMaxY; y++, nY += nLen)
{
const sal_uInt32 nBottom(std::min(nMaxY, nY + nLen));
SetFillColor((x & 0x0001) ^ (y & 0x0001) ? aStart : aEnd);
DrawRect(Rectangle(nX, nY, nRight, nBottom));
}
}
Pop();
}
void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ) void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags )
{ {
Rectangle aDstRect( PixelToLogic( Point() ), GetOutputSize() ); Rectangle aDstRect( PixelToLogic( Point() ), GetOutputSize() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment