From fae727b83352ae782626af6a312cb031f3a5670a Mon Sep 17 00:00:00 2001 From: Jakob Voigts <jvoigts@mit.edu> Date: Sat, 27 Feb 2016 13:45:40 -0500 Subject: [PATCH] fixed channel double-click bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Used to use spreadSelection->getSelectedId(), which wasn’t set properly when the mouse wheel was used to change heights. Now goes directly for the text value. --- Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp index 90c6b396e..4247910da 100644 --- a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp +++ b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp @@ -732,7 +732,9 @@ void sliderValueChanged (Slider* slider) int LfpDisplayCanvas::getChannelHeight() { - return spreads[spreadSelection->getSelectedId()-1].getIntValue(); + //return spreads[spreadSelection->getSelectedId()-1].getIntValue(); + return (int)spreadSelection->getText().getIntValue(); + } @@ -1637,7 +1639,7 @@ void LfpDisplay::setChannelHeight(int r, bool resetSingle) if (resetSingle && singleChan != -1) { std::cout << "width " << getWidth() << " numchans " << numChans << " height " << getChannelHeight() << std::endl; - setSize(getWidth(),numChans*ch); + setSize(getWidth(),numChans*getChannelHeight()); viewport->setScrollBarsShown(true,false); viewport->setViewPosition(Point<int>(0,singleChan*r)); singleChan = -1; -- GitLab