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:
@@ -199,6 +199,10 @@ bool ControlLineManager::pick3(bool picked)
|
|||||||
|
|
||||||
bool ControlLineManager::drag1(int modifierKey)
|
bool ControlLineManager::drag1(int modifierKey)
|
||||||
{
|
{
|
||||||
|
if (action != Action::DRAGGING) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
EditDataProvider* provider = getEditProvider();
|
EditDataProvider* provider = getEditProvider();
|
||||||
|
|
||||||
if (!provider || selected_object < 1) {
|
if (!provider || selected_object < 1) {
|
||||||
@@ -263,6 +267,20 @@ bool ControlLineManager::drag1(int modifierKey)
|
|||||||
return false;
|
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
|
bool ControlLineManager::getEdited(void) const
|
||||||
{
|
{
|
||||||
return edited;
|
return edited;
|
||||||
|
@@ -87,6 +87,8 @@ public:
|
|||||||
~ControlLineManager();
|
~ControlLineManager();
|
||||||
|
|
||||||
bool getEdited(void) const;
|
bool getEdited(void) const;
|
||||||
|
/** Release anything that is currently being dragged. */
|
||||||
|
void releaseEdit(void);
|
||||||
void removeAll(void);
|
void removeAll(void);
|
||||||
/** Sets whether or not the lines are visible and interact-able. */
|
/** Sets whether or not the lines are visible and interact-able. */
|
||||||
void setActive(bool active);
|
void setActive(bool active);
|
||||||
|
@@ -778,6 +778,7 @@ void PerspCorrection::linesEditButtonPressed(void)
|
|||||||
listener->unsetTweakOperator(this);
|
listener->unsetTweakOperator(this);
|
||||||
listener->refreshPreview(EvPerspRender);
|
listener->refreshPreview(EvPerspRender);
|
||||||
}
|
}
|
||||||
|
lines->releaseEdit();
|
||||||
lines->setDrawMode(false);
|
lines->setDrawMode(false);
|
||||||
lines->setActive(false);
|
lines->setActive(false);
|
||||||
if (panel_listener) {
|
if (panel_listener) {
|
||||||
|
Reference in New Issue
Block a user