Skip to content

Commit

Permalink
feat: update code in src/examples and src/ui
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixoo committed Jan 17, 2025
1 parent 4105e3a commit 9555b8e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/examples/rasterEffects/eShadow/eshadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ eShadow::eShadow() :
mBlurRadius = enve::make_shared<QrealAnimator>("blur radius");
mOpacity = enve::make_shared<QrealAnimator>("opacity");
mColor = enve::make_shared<ColorAnimator>();
mTranslation = enve::make_shared<QPointFAnimator>("translation");
mTranslation = enve::make_shared<QVector3DAnimator>("translation");

mBlurRadius->setValueRange(0, 300);
mBlurRadius->setCurrentBaseValue(10);
ca_addChild(mBlurRadius);

mTranslation->setValuesRange(-1000, 1000);
mTranslation->setBaseValue(QPointF(0, 0));
mTranslation->setBaseValue(QVector3D(0, 0, 0));
ca_addChild(mTranslation);

mColor->setColor(Qt::black);
Expand Down
4 changes: 2 additions & 2 deletions src/examples/rasterEffects/eShadow/eshadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "eshadow_global.h"
#include "enveCore/skia/skqtconversions.h"
#include "enveCore/Animators/coloranimator.h"
#include "enveCore/Animators/qpointfanimator.h"
#include "enveCore/Animators/qvector3danimator.h"
#include "enveCore/gpurendertools.h"

class eShadowCaller : public RasterEffectCaller {
Expand Down Expand Up @@ -73,7 +73,7 @@ class eShadow : public CustomRasterEffect {
qsptr<QrealAnimator> mBlurRadius;
qsptr<QrealAnimator> mOpacity;
qsptr<ColorAnimator> mColor;
qsptr<QPointFAnimator> mTranslation;
qsptr<QVector3DAnimator> mTranslation;
};

#endif // ESHADOW_H
6 changes: 3 additions & 3 deletions src/examples/rasterEffects/oil/oileffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
OilEffect::OilEffect() :
RasterEffect("oil painting", HardwareSupport::cpuPreffered,
true, RasterEffectType::OIL) {
mBrushSize = enve::make_shared<QPointFAnimator>(
QPointF{16., 64.}, QPointF{4., 4.},
QPointF{999.999, 999.999}, QPointF{1., 1.},
mBrushSize = enve::make_shared<QVector3DAnimator>(
QVector3D{16., 64., 0.}, QVector3D{4., 4., 4.},
QVector3D{999.999, 999.999, 999.999}, QVector3D{1., 1., 1.},
"min", "max", "brush size");
ca_addChild(mBrushSize);
connect(mBrushSize->getYAnimator(),
Expand Down
4 changes: 2 additions & 2 deletions src/examples/rasterEffects/oil/oileffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "rastereffect.h"

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

class CORE_EXPORT OilEffect : public RasterEffect {
e_OBJECT
Expand All @@ -18,7 +18,7 @@ class CORE_EXPORT OilEffect : public RasterEffect {
const qreal relFrame, const qreal resolution,
const qreal influence, BoxRenderData* const data) const;
private:
qsptr<QPointFAnimator> mBrushSize;
qsptr<QVector3DAnimator> mBrushSize;
qsptr<QrealAnimator> mAccuracy;
qsptr<QrealAnimator> mStrokeLength;
qsptr<QrealAnimator> mMaxStrokes;
Expand Down
4 changes: 2 additions & 2 deletions src/ui/widgets/qrealanimatorvalueslider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Fork of enve - Copyright (C) 2016-2020 Maurycy Liebner

#include "qrealanimatorvalueslider.h"
#include "Animators/qpointfanimator.h"
#include "Animators/qvector3danimator.h"
#include "themesupport.h"
#include "canvas.h"
#include "Private/document.h"
Expand Down Expand Up @@ -79,7 +79,7 @@ QrealAnimatorValueSlider::QrealAnimatorValueSlider(QString name,
QrealAnimator* QrealAnimatorValueSlider::getTransformTargetSibling() {
if(mTransformTarget) {
const auto parent = mTransformTarget->getParent();
if(const auto qPA = enve_cast<QPointFAnimator*>(parent)) {
if(const auto qPA = enve_cast<QVector3DAnimator*>(parent)) {
const bool thisX = qPA->getXAnimator() == mTransformTarget;
return thisX ? qPA->getYAnimator() :
qPA->getXAnimator();
Expand Down

0 comments on commit 9555b8e

Please sign in to comment.