diff --git a/Engine/RotoPaint.cpp b/Engine/RotoPaint.cpp index 290eb16002..6ab6116152 100644 --- a/Engine/RotoPaint.cpp +++ b/Engine/RotoPaint.cpp @@ -1884,6 +1884,9 @@ RotoPaint::drawOverlay(double time, colorChanged = true; } + glEnable(GL_POINT_SMOOTH); + glPointSize(cpWidth * screenPixelRatio); + // code below draws GL_POINTS for (SelectedCPs::const_iterator cpIt = _imp->ui->selectedCps.begin(); cpIt != _imp->ui->selectedCps.end(); ++cpIt) { @@ -1907,7 +1910,6 @@ RotoPaint::drawOverlay(double time, } } // for(cpIt) - glPointSize(cpWidth * screenPixelRatio); glBegin(GL_POINTS); glVertex2f(x,y); glEnd(); @@ -1938,6 +1940,7 @@ RotoPaint::drawOverlay(double time, } if (drawFeather) { + glEnable(GL_POINT_SMOOTH); glPointSize(cpWidth * screenPixelRatio); glBegin(GL_POINTS); glVertex2f(xF, yF); @@ -2557,6 +2560,11 @@ RotoPaint::onOverlayPenDown(double time, _imp->ui->selectedCps.clear(); _imp->ui->setCurrentTool( _imp->ui->selectAllAction.lock() ); + + // continue editing the tangent + + //->ui->tangentBeingDragged = *it; + //_imp->ui->state = eEventStateDraggingRightTangent; } else { BezierCPPtr fp = _imp->ui->builtBezier->getFeatherPointAtIndex(i); assert(fp); diff --git a/Engine/RotoPaintInteract.cpp b/Engine/RotoPaintInteract.cpp index ca22bf761f..0a4dd4cdd3 100644 --- a/Engine/RotoPaintInteract.cpp +++ b/Engine/RotoPaintInteract.cpp @@ -207,7 +207,6 @@ RotoPaintInteract::drawSelectedCp(double time, bool drawLeftHandle = leftDeriv.x != x || leftDeriv.y != y; bool drawRightHandle = rightDeriv.y != x || rightDeriv.y != y; - glEnable(GL_POINT_SMOOTH); glBegin(GL_POINTS); if (drawLeftHandle) { if (colorLeftTangent) { @@ -238,7 +237,6 @@ RotoPaintInteract::drawSelectedCp(double time, glVertex2d(rightDeriv.x, rightDeriv.y); } glEnd(); - glDisable(GL_POINT_SMOOTH); } // drawSelectedCp void @@ -919,6 +917,7 @@ RotoPaintInteract::handleControlPointSelection(const std::pairmovePointLeftAndRightIndex(cp, fp, time, dx, dy, otherDiffX, otherDiffY, dx, dy, otherFpDiffX, otherFpDiffY, breakTangents, draggedPointIsFeather); + if (both) { + if (!left) { + dx = -dx; + dy = -dy; + } + cp.getBezier()->movePointLeftAndRightIndex(cp, fp, time, dx, dy, -dx, -dy, dx, dy, -dx, -dy, breakTangents, draggedPointIsFeather); } else { - cp.getBezier()->movePointLeftAndRightIndex(cp, fp, time, otherDiffX, otherDiffY, dx, dy, otherFpDiffX, otherFpDiffY, dx, dy, breakTangents, draggedPointIsFeather); + if (left) { + cp.getBezier()->movePointLeftAndRightIndex(cp, fp, time, dx, dy, otherDiffX, otherDiffY, dx, dy, otherFpDiffX, otherFpDiffY, breakTangents, draggedPointIsFeather); + } else { + cp.getBezier()->movePointLeftAndRightIndex(cp, fp, time, otherDiffX, otherDiffY, dx, dy, otherFpDiffX, otherFpDiffY, dx, dy, breakTangents, draggedPointIsFeather); + } } } } @@ -922,7 +931,7 @@ MoveTangentUndoCommand::redo() bool autoKeying = roto->getContext()->isAutoKeyingEnabled(); - dragTangent( _time, *cp, *fp, transform, _dx, _dy, _left, autoKeying, _breakTangents, _tangentBeingDragged->isFeatherPoint() ); + dragTangent( _time, *cp, *fp, transform, _dx, _dy, false, _left, autoKeying, _breakTangents, _tangentBeingDragged->isFeatherPoint() ); if (_firstRedoCalled) { @@ -1459,8 +1468,12 @@ MakeBezierUndoCommand::redo() int lastIndex = _newCurve->getControlPointsCount() - 1; assert(lastIndex >= 0); _lastPointAdded = lastIndex; - _newCurve->moveLeftBezierPoint(lastIndex, _time, -_dx, -_dy); - _newCurve->moveRightBezierPoint(lastIndex, _time, _dx, _dy); + Transform::Matrix3x3 transform; + _newCurve->getTransformAtTime(_time, &transform); + BezierCPPtr cp = _newCurve->getControlPointAtIndex(lastIndex); + BezierCPPtr fp = _newCurve->getFeatherPointAtIndex(lastIndex); + + dragTangent(_time, *cp, *fp, transform, _dx, _dy, true, false, false, false, false); } RotoItemPtr parentItem;