Skip to content

Commit

Permalink
fixup! LightPositionTool : Drag to place targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Jan 4, 2024
1 parent 9e71234 commit 8f102b1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/GafferSceneUI/LightPositionTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,12 +876,24 @@ bool LightPositionTool::buttonPress( const ButtonEvent &event )
return true;
}

UndoScope undoScope( selection().back().editTarget()->ancestor<ScriptNode>() );
UndoScope undoScope( selection().back().editTarget()->ancestor<ScriptNode>(), UndoScope::Enabled, undoMergeGroup() );

placeTarget( event.line );
return true;
}

bool LightPositionTool::buttonRelease( const ButtonEvent &event )
{
if( event.button != ButtonEvent::Left || !activePlug()->getValue() || getTargetMode() == TargetMode::None )
{
return false;
}

// We're not in a drag event, but we do want to increment `TransformTool::m_mergeGroupId`
TransformTool::dragEnd();
return true;
}

bool LightPositionTool::placeTarget( const LineSegment3f &eventLine )
{
ScenePlug::ScenePath scenePath;
Expand Down

0 comments on commit 8f102b1

Please sign in to comment.