Skip to content

Commit

Permalink
Fix rotopaint overlay 2.5 (#986)
Browse files Browse the repository at this point in the history
* RotoPaint: always draw the overlay when the tool is part of the overlay
  • Loading branch information
devernay authored Jul 22, 2024
1 parent 4253886 commit 7eea73e
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions Engine/RotoPaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,22 @@ RotoPaint::onOverlayPenMotion(double time,
cursorSet = true;
}

switch (_imp->ui->selectedTool) {
case eRotoToolSolidBrush:
case eRotoToolEraserBrush:
case eRotoToolClone:
case eRotoToolReveal:
case eRotoToolBlur:
case eRotoToolSharpen:
case eRotoToolSmear:
case eRotoToolDodge:
case eRotoToolBurn: {
redraw = true; // Those tools use the overlay to draw the tool
}
default:
break;
} // switch

if ( !cursorSet && _imp->ui->showCpsBbox && (_imp->ui->state != eEventStateDraggingControlPoint) && (_imp->ui->state != eEventStateDraggingSelectedControlPoints)
&& ( _imp->ui->state != eEventStateDraggingLeftTangent) &&
( _imp->ui->state != eEventStateDraggingRightTangent) ) {
Expand All @@ -2751,8 +2767,10 @@ RotoPaint::onOverlayPenMotion(double time,
} else if (lastHoverState != eHoverStateNothing) {
newState = eHoverStateNothing;
}
redraw = _imp->ui->hoverState != newState;
_imp->ui->hoverState = newState;
if (_imp->ui->hoverState != newState) {
redraw = true;
_imp->ui->hoverState = newState;
}
}
const bool featherVisible = _imp->ui->isFeatherVisible();

Expand Down Expand Up @@ -3161,7 +3179,15 @@ RotoPaint::onOverlayPenUp(double /*time*/,
**/
setCurrentCursor(eCursorBusy);
context->evaluateNeatStrokeRender();
setCurrentCursor(eCursorDefault);
if ( context->isRotoPaint() &&
( ( _imp->ui->selectedRole == eRotoRoleMergeBrush) ||
( _imp->ui->selectedRole == eRotoRoleCloneBrush) ||
( _imp->ui->selectedRole == eRotoRolePaintBrush) ||
( _imp->ui->selectedRole == eRotoRoleEffectBrush) ) ) {
setCurrentCursor(eCursorCross);
} else {
setCurrentCursor(eCursorDefault);
}
_imp->ui->strokeBeingPaint->setStrokeFinished();
ret = true;
}
Expand Down

0 comments on commit 7eea73e

Please sign in to comment.