aboutsummaryrefslogtreecommitdiff
path: root/scatterplot.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-10-06 11:05:36 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-10-06 11:05:36 -0300
commit19d4b793783ad7751179fe0bd63eee48a7ce8ae8 (patch)
tree2687bf907889f7d3af87f2245696343918affd40 /scatterplot.cpp
parent9fc535e76bad0fb53a0b0760ff475117de61ff76 (diff)
min/max calculation for scaling corrected (Scatterplot).
Diffstat (limited to 'scatterplot.cpp')
-rw-r--r--scatterplot.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/scatterplot.cpp b/scatterplot.cpp
index f979962..10f7f34 100644
--- a/scatterplot.cpp
+++ b/scatterplot.cpp
@@ -66,10 +66,10 @@ void Scatterplot::setXY(const arma::mat &xy)
m_xy = xy;
- float min = std::min(m_xy.col(0).min(), m_oldXY.col(0).max());
+ float min = std::min(m_xy.col(0).min(), m_oldXY.col(0).min());
float max = std::max(m_xy.col(0).max(), m_oldXY.col(0).max());
m_sx.setDomain(min, max);
- min = std::min(m_xy.col(1).min(), m_oldXY.col(1).max());
+ min = std::min(m_xy.col(1).min(), m_oldXY.col(1).min());
max = std::max(m_xy.col(1).max(), m_oldXY.col(1).max());
m_sy.setDomain(min, max);
@@ -251,13 +251,18 @@ void Scatterplot::resetAnimation()
void Scatterplot::startAnimation()
{
+ if (m_t < 1.0f) {
+ m_t = 1.0f;
+ return;
+ }
+
resetAnimation();
update();
}
void Scatterplot::animationTick()
{
- if (m_t < 1.f) {
+ if (m_t < 1.0f) {
m_t += 0.1f;
updateGeometry();
}