Made vector clip default to insertion if there is no previous vector to edit (#522). Also fixed a minor glitch when mouse was outside the window on that mode.

Originally committed to SVN as r1709.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-13 23:53:43 +00:00
parent 3aaffcf0fc
commit 400e37c2cd
1 changed files with 10 additions and 4 deletions

View File

@ -78,6 +78,10 @@ VisualToolVectorClip::VisualToolVectorClip(VideoDisplay *parent,wxToolBar *_tool
toolBar->ToggleTool(BUTTON_DRAG,true);
toolBar->Realize();
toolBar->Show(true);
// Set default mode
PopulateFeatureList();
if (features.size() == 0) SetMode(1);
}
@ -176,10 +180,12 @@ void VisualToolVectorClip::Draw() {
// Draw preview of inserted line
if (mode == 1 || mode == 2) {
if (spline.curves.size()) {
SplineCurve *c0 = &spline.curves.front();
SplineCurve *c1 = &spline.curves.back();
DrawDashedLine(mx,my,c0->p1.x,c0->p1.y,6);
DrawDashedLine(mx,my,c1->GetEndPoint().x,c1->GetEndPoint().y,6);
if (mx != -1 || my != -1) {
SplineCurve *c0 = &spline.curves.front();
SplineCurve *c1 = &spline.curves.back();
DrawDashedLine(mx,my,c0->p1.x,c0->p1.y,6);
DrawDashedLine(mx,my,c1->GetEndPoint().x,c1->GetEndPoint().y,6);
}
}
}