From a2ab8d285fffd918f1cc36a0f250ba21b631fe6f Mon Sep 17 00:00:00 2001 From: xenakios Date: Sat, 20 Jan 2018 22:39:33 +0200 Subject: [PATCH] glah --- Source/PluginEditor.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 016fa04..ccfc986 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -424,15 +424,19 @@ void WaveformComponent::paint(Graphics & g) //m_thumb->drawChannels(g, { 0,m_topmargin,getWidth(),getHeight()-m_topmargin }, // 0.0, thumblen, 1.0f); g.setColour(Colours::white.withAlpha(0.5f)); - int xcorleft = (int)jmap(m_time_sel_start, m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); - int xcorright = (int)jmap(m_time_sel_end, m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); - g.fillRect(xcorleft, m_topmargin, xcorright - xcorleft, getHeight() - m_topmargin); + double sel_len = m_time_sel_end - m_time_sel_start; + //if (sel_len > 0.0 && sel_len < 1.0) + { + int xcorleft = (int)jmap(m_time_sel_start, m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); + int xcorright = (int)jmap(m_time_sel_end, m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); + g.fillRect(xcorleft, m_topmargin, xcorright - xcorleft, getHeight() - m_topmargin); + } if (m_file_cached.first.getLength() > 0.0 && (bool)ShowFileCacheRange.getValue()) { g.setColour(Colours::red.withAlpha(0.2f)); - xcorleft = (int)jmap(m_file_cached.first.getStart(), m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); - xcorright = (int)jmap(m_file_cached.first.getEnd(), m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); + int xcorleft = (int)jmap(m_file_cached.first.getStart(), m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); + int xcorright = (int)jmap(m_file_cached.first.getEnd(), m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); g.fillRect(xcorleft, 0, xcorright - xcorleft, m_topmargin / 2); xcorleft = (int)jmap(m_file_cached.second.getStart(), m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth()); xcorright = (int)jmap(m_file_cached.second.getEnd(), m_view_range.getStart(), m_view_range.getEnd(), 0, getWidth());