Skip to content

Commit

Permalink
feat: use QVector3DAnimator in core/texteffect
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixoo committed Jan 17, 2025
1 parent e419a85 commit c1724f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/core/texteffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
#include "Boxes/textboxrenderdata.h"
#include "Boxes/textbox.h"

#include "Animators/qpointfanimator.h"
#include "Animators/qvector3danimator.h"
#include "MovablePoints/animatedpoint.h"

class TextEffectPoint : public AnimatedPoint {
public:
TextEffectPoint(QPointFAnimator * const anim,
TextEffectPoint(QVector3DAnimator * const anim,
TextEffect* const effect) :
AnimatedPoint(anim, TYPE_PATH_POINT), mTextEffect(effect) {}

Expand Down Expand Up @@ -70,22 +70,22 @@ TextEffect::TextEffect() : eEffect("text effect") {
mDiminishInfluence = enve::make_shared<QrealAnimator>(
1, 0, 1, 0.1, "influence");

mP1Anim = enve::make_shared<QPointFAnimator>("point 1");
mP1Anim = enve::make_shared<QVector3DAnimator>("point 1");
mP1Anim->getYAnimator()->setValueRange(0, 1);
mP1Anim->getYAnimator()->setPrefferedValueStep(0.1);
mP1Anim->setBaseValue(-40, 0);
mP2Anim = enve::make_shared<QPointFAnimator>("point 2");
mP2Anim = enve::make_shared<QVector3DAnimator>("point 2");
mP2Anim->getYAnimator()->setValueRange(0, 1);
mP2Anim->getYAnimator()->setPrefferedValueStep(0.1);
mP2Anim->setBaseValue(-10, 1);
mP3Anim = enve::make_shared<QPointFAnimator>("point 3");
mP3Anim = enve::make_shared<QVector3DAnimator>("point 3");
mP3Anim->getYAnimator()->setValueRange(0, 1);
mP3Anim->getYAnimator()->setPrefferedValueStep(0.1);
mP3Anim->setBaseValue(20, 1);
mP4Anim = enve::make_shared<QPointFAnimator>("point 4");
mP4Anim = enve::make_shared<QVector3DAnimator>("point 4");
mP4Anim->getYAnimator()->setValueRange(0, 1);
mP4Anim->getYAnimator()->setPrefferedValueStep(0.1);
mP4Anim->setBaseValue(50, 0);
mP4Anim->setBaseValue(50, 0, 0);

setPointsHandler(enve::make_shared<PointsHandler>());
mP1Pt = enve::make_shared<TextEffectPoint>(mP1Anim.get(), this);
Expand Down
8 changes: 4 additions & 4 deletions src/core/texteffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ class CORE_EXPORT TextEffect : public eEffect {
qsptr<StaticComplexAnimator> mDiminishCont;
qsptr<QrealAnimator> mDiminishInfluence;

qsptr<QPointFAnimator> mP1Anim;
qsptr<QPointFAnimator> mP2Anim;
qsptr<QPointFAnimator> mP3Anim;
qsptr<QPointFAnimator> mP4Anim;
qsptr<QVector3DAnimator> mP1Anim;
qsptr<QVector3DAnimator> mP2Anim;
qsptr<QVector3DAnimator> mP3Anim;
qsptr<QVector3DAnimator> mP4Anim;

stdsptr<AnimatedPoint> mP1Pt;
stdsptr<AnimatedPoint> mP2Pt;
Expand Down

0 comments on commit c1724f3

Please sign in to comment.