From 19d4b793783ad7751179fe0bd63eee48a7ce8ae8 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 6 Oct 2015 11:05:36 -0300 Subject: min/max calculation for scaling corrected (Scatterplot). --- scatterplot.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'scatterplot.cpp') 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(); } -- cgit v1.2.3