From 7eea73e6a0e58318c87ae00fd449679339fa2059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Mon, 22 Jul 2024 16:10:28 +0200 Subject: [PATCH] Fix rotopaint overlay 2.5 (#986) * RotoPaint: always draw the overlay when the tool is part of the overlay --- Engine/RotoPaint.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/Engine/RotoPaint.cpp b/Engine/RotoPaint.cpp index 61f965861..e79add4fb 100644 --- a/Engine/RotoPaint.cpp +++ b/Engine/RotoPaint.cpp @@ -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) ) { @@ -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(); @@ -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; }