diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-04-04 17:15:26 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-04-04 17:15:26 -0300 |
commit | e4d94411fc8d955072f632fda923dc04a0986ea5 (patch) | |
tree | c9ca0552ca73cc248c44d841c5ca4f3de77bf1d7 | |
parent | e7a02388c96b8f5815497acb7b2671cfe7b3e88e (diff) |
VoronoiSplat: minor implementation changes.
-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; |