fill when mouse leaves

This commit is contained in:
Alexandre Quessy
2013-11-15 02:29:19 +01:00
parent 2bd81d9736
commit 9f0736a6a8
+11 -1
View File
@@ -260,7 +260,6 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
{
manager.addPolyLine(point);
should_render = true;
manager.setStyle(POLYGON);
}
else
{
@@ -268,6 +267,17 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
manager.addPoint(point);
should_render = true;
}
if (event.Leaving())
{
manager.setStyle(POLYGON);
should_render = true;
}
else if (event.Entering())
{
manager.setStyle(LINES);
should_render = true;
}
if (should_render)
Render();
}