Skip to content

Commit

Permalink
Merge pull request #181 from naivisoftware/sequencercurveviews_icon_a…
Browse files Browse the repository at this point in the history
…nd_crash_fix

- crash & icon fix in sequencecurvetrackview_template.h
  • Loading branch information
cklosters committed May 10, 2022
2 parents 803ea57 + 6045bac commit ddaab6e
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions modules/napsequencegui/src/sequencecurvetrackview_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,6 @@ namespace nap
auto* action = mState.mAction->getDerived<sequenceguiactions::CurvePointActionPopup<T>>();
int curveIndex = action->mCurveIndex;

if (ImGui::Button("Delete"))
{
auto& curve_controller = getEditor().getController<SequenceControllerCurve>();
curve_controller.deleteCurvePoint(
action->mTrackID,
action->mSegmentID,
action->mControlPointIndex,
action->mCurveIndex);
updateSegmentInClipboard(action->mTrackID, action->mSegmentID);
mCurveCache.clear();

mState.mAction = sequenceguiactions::createAction<sequenceguiactions::None>();
mState.mDirty = true;

ImGui::CloseCurrentPopup();
}

float value = action->mValue * (action->mMaximum[curveIndex] - action->mMinimum[curveIndex]) + action->mMinimum[curveIndex];
if (ImGui::InputFloat("value", &value))
{
Expand Down Expand Up @@ -115,6 +98,25 @@ namespace nap
mState.mDirty = true;
}

if (ImGui::ImageButton(mService.getGui().getIcon(nap::icon::del)))
{
auto& curve_controller = getEditor().getController<SequenceControllerCurve>();
curve_controller.deleteCurvePoint(
action->mTrackID,
action->mSegmentID,
action->mControlPointIndex,
action->mCurveIndex);
updateSegmentInClipboard(action->mTrackID, action->mSegmentID);
mCurveCache.clear();

mState.mAction = sequenceguiactions::createAction<sequenceguiactions::None>();
mState.mDirty = true;

ImGui::CloseCurrentPopup();
}

ImGui::SameLine();

if (ImGui::ImageButton(mService.getGui().getIcon(nap::icon::ok)))
{
mState.mAction = sequenceguiactions::createAction<sequenceguiactions::None>();
Expand Down

0 comments on commit ddaab6e

Please sign in to comment.