diff options
-rw-r--r-- | voronoisplat.cpp | 7 | ||||
-rw-r--r-- | voronoisplat.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/voronoisplat.cpp b/voronoisplat.cpp index 1b8e9f8..15bb9bd 100644 --- a/voronoisplat.cpp +++ b/voronoisplat.cpp @@ -14,6 +14,8 @@ static const float DEFAULT_ALPHA = 5.0f; static const float DEFAULT_BETA = 20.0f; +static const int SAMPLES = 128; + static int nextPow2(int n) { // TODO: check for overflows @@ -34,6 +36,7 @@ VoronoiSplat::VoronoiSplat(QQuickItem *parent) , m_valuesChanged(false) , m_colorScaleChanged(false) { + setFlag(QQuickItem::ItemHasContents); setTextureFollowsItemSize(false); } @@ -478,8 +481,8 @@ void VoronoiSplatRenderer::updateTransform() GLfloat ty = 2.0f * m_sy.offset() - 1.0f; // The transform matrix should be this (but transposed -- column major): - // [ sx 0.0f 0.0f -tx ] - // [ 0.0f sy 0.0f -ty ] + // [ sx 0.0f 0.0f tx ] + // [ 0.0f sy 0.0f ty ] // [ 0.0f 0.0f 0.0f 0.0f ] // [ 0.0f 0.0f 0.0f 1.0f ] m_transform[0][0] = sx; diff --git a/voronoisplat.h b/voronoisplat.h index 30f3be0..962389e 100644 --- a/voronoisplat.h +++ b/voronoisplat.h @@ -15,8 +15,6 @@ class VoronoiSplat Q_PROPERTY(float alpha READ alpha WRITE setAlpha NOTIFY alphaChanged) Q_PROPERTY(float beta READ beta WRITE setBeta NOTIFY betaChanged) public: - static const int SAMPLES = 128; - VoronoiSplat(QQuickItem *parent = 0); Renderer *createRenderer() const; |