38 YAssert(
bool(g),
"Invalid graphics context found.");
40 if(IsInInterval<int>(y, g.GetHeight())
41 && !((x1 < 0 && x2 < 0) || (x1 >= g.GetWidth() && x2 >= g.GetWidth())))
46 FillPixel<PixelType>(&g.GetBufferPtr()[y * g.GetWidth() + x1],
56 YAssert(
bool(g),
"Invalid graphics context found.");
58 if(IsInInterval<int>(x, g.GetWidth())
59 && !((y1 < 0 && y2 < 0) || (y1 >= g.GetHeight()
60 && y2 >= g.GetHeight())))
65 FillVerticalLine<PixelType>(&g.GetBufferPtr()[y1 * g.GetWidth() + x],
66 y2 - y1, g.GetWidth(), c);
85 "Not drawing an oblique line: the line is horizontal.");
86 YAssert(x1 != x2,
"Not drawing an oblique line: the line is vertical.");
88 if(Rect(g.GetSize()).
Contains(x1, y1)
89 && Rect(g.GetSize()).
Contains(x2, y2))
98 SDst dx(abs(x2 - x1)), dy(abs(y2 - y1));
105 const SDst dx2(dx << 1), dy2(dy << 1);
141 return DrawObliqueLine(g, x1, y1, x2, y2, c);
147 const SPos x1(pt.X), y1(pt.Y), x2(x1 + s.Width - 1), y2(y1 + s.Height - 1);
166 FillRect<PixelType>(g.GetBufferPtr(), g.GetSize(), pt, s, c);
200 const auto dst(g.GetBufferPtr());
201 const Size& s(g.GetSize());
202 SPos x(0), y(r), d(1 - r);
204 for(
SDst dt(2), db(4); x <= y;
yunseq(dt += 2, db += 2, ++x))
206 Draw8Points(dst, s, pt.X, pt.Y, x, y, c);