The following code gets weird results:
Graphics g(hdc);
Pen pen(Color(0, 0, 0), 50.0f);
std::vector<PointF> line;
line.push_back({ 200, 200 });
line.push_back({ 200, 100 });
line.push_back({ 200, 100 });
line.push_back({ 300, 100 });
g.DrawLines(&pen, line.data(),line.size());
std::vector<PointF> line2;
line2.push_back({ 400, 200 });
line2.push_back({ 400, 100 });
line2.push_back({ 400, 60 });
line2.push_back({ 400, 100 });
line2.push_back({ 500, 100 });
g.DrawLines(&pen, line2.data(), line2.size());
std::vector<PointF> line3;
line3.push_back({ 600, 200 });
line3.push_back({ 600, 100 });
line3.push_back({ 600, 95 });
line3.push_back({ 600, 100 });
line3.push_back({ 700, 100 });
g.DrawLines(&pen, line3.data(), line3.size());
for (std::size_t i = 0; i < line3.size(); ++i) {
line3[i].X += 200;
}
for (std::size_t i = 1; i < line3.size(); ++i)
{
g.DrawLine(&pen, line3[i - 1], line3[i]);
}
Here is the image drawn:
Comments (by images' numbers):
- No issues, works as expected
- Adding one point with displacement more than half of pen size; works as expected
- Moving this point closer so the distance is less than half of pen size. The first issue is here. What is this white area and the diagonal? And where is the part on top as on image (2)?
- Drawing the same image as (3) with series of DrawLine instead of DrawLines. What is this white box at the left top corner and where is the part on top as on image (2)?
Is this a bug or I misinterpret somehow pen's brushes shapes and drawing modes?
(OS: Windows Version 10.0.19044.1889; SDK Version 10.0.26100.0)