Leave control lines in good state on commit

When exiting perspective control line editing mode while dragging a
control line, set the geometry and control line state to the appropriate
state corresponding to when lines are not being dragged.
This commit is contained in:
Lawrence Lee
2021-05-22 18:17:30 -07:00
parent a5de8920fb
commit 3ade11c970
3 changed files with 21 additions and 0 deletions

View File

@@ -199,6 +199,10 @@ bool ControlLineManager::pick3(bool picked)
bool ControlLineManager::drag1(int modifierKey)
{
if (action != Action::DRAGGING) {
return false;
}
EditDataProvider* provider = getEditProvider();
if (!provider || selected_object < 1) {
@@ -263,6 +267,20 @@ bool ControlLineManager::drag1(int modifierKey)
return false;
}
void ControlLineManager::releaseEdit(void)
{
action = Action::NONE;
if (selected_object > 0) {
mouseOverGeometry[selected_object]->state = Geometry::NORMAL;
}
edited = true;
callbacks->lineChanged();
drawing_line = false;
selected_object = -1;
}
bool ControlLineManager::getEdited(void) const
{
return edited;