--User changes

-Add gnarly variation.

--Bug fixes
 -Fix reading of post variations in .chaos files.
 -Make selection of points on color curves control apply only to the current selection as specified by the radio buttons below.

--Code changes
 -Use std::complex<T> type in some variations' CPU code.
This commit is contained in:
Person
2019-05-28 20:08:59 -07:00
parent a698edf887
commit c000c67d45
9 changed files with 234 additions and 226 deletions

View File

@ -39,6 +39,7 @@ public:
void Set(int curveIndex, int pointIndex, const QPointF& point);
void Set(Curves<float>& curves);
void SetTop(CurveIndex curveIndex);
size_t SelectedCurveIndex() const { return m_Index; }
Q_SIGNALS:
void PointChangedSignal(int curveIndex, int pointIndex, const QPointF& point);
@ -87,13 +88,23 @@ public:
EllipseItem(const QRectF& rect, int curveIndex, int pointIndex, CurvesGraphicsView* viewParent, QGraphicsItem* parent = nullptr)
: QGraphicsEllipseItem(rect, parent)
{
m_CurveIndex = curveIndex;
m_PointIndex = pointIndex;
m_ViewParent = viewParent;
setFlag(QGraphicsItem::ItemSendsScenePositionChanges);
setFlag(QGraphicsItem::ItemIsSelectable);
setFlag(QGraphicsItem::ItemIsMovable);
setPen(Qt::NoPen);
m_CurveIndex = curveIndex;
m_PointIndex = pointIndex;
m_ViewParent = viewParent;
}
/// <summary>
/// Set whether this item is selectable, which means this curve is the current one.
/// </summary>
/// <param name="b">True if selected, else false.</param>
void SetCurrent(bool b)
{
setFlag(QGraphicsItem::ItemIsMovable, b);
setZValue(b ? 2 : 1);
}
/// <summary>
@ -125,7 +136,7 @@ protected:
/// <returns>The new position</returns>
virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value) override
{
if (change == ItemPositionChange && scene())
if ((change == ItemPositionChange) && scene())
{
//Value is the new position.
QPointF newPos = value.toPointF();