Strange things happen in my Win Forms App. I create a Custom LineControl, which simply draws full transparent control with line inside. Line is creating dynamically by User (with preview like in Win Paint). When i create new Line ones for a while it daws a dashed line. Like on picture above. I've drawn 4 line and suddenly 5th is dashed. I cant understard that. Thickness of dashed line is different. Always 1px.

Pen p and SolidBrush b used to draw Line are instantiated in constructor
|
OnPaint method looks like that:
|
Any ideas?
waserekPosted Jan 24, 2011, 2:00 PM
waserekPosted Jan 23, 2011, 5:41 PM
This is how it works: The control calculate 2 other point to draw polygon on GraphicalPath base on the thickness of control. I determine that dashed line is draw only with specific angle. When direction factor on line m= (EndPoint.y-StartPoint.y)/(EndPoint.x-StartPoint.x) is between 0.6 and 1.2. Its crazy wright? I dont see the connection.
FroglegPosted Jan 23, 2011, 2:48 PM