From 32af3179ad62d33aebc5d4b48bfbf91ca7f666d6 Mon Sep 17 00:00:00 2001 From: Rodney Date: Jul 09 2020 16:05:11 +0000 Subject: Merge pull request #3391 from konero/invert-waveform Fill Audio Waveform --- diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index 15eedd1..6e8fbf1 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -1500,7 +1500,6 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { o->rowToFrameAxis(offset); // pixels since start of clip int trackWidth = trackBounds.length(); - int lastMin, lastMax; DoublePair minmax; soundLevel->getValueAtPixel(o, soundPixel, minmax); @@ -1508,8 +1507,6 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { double pmax = minmax.second; int center = trackBounds.middle(); - lastMin = tcrop((int)pmin, -trackWidth / 2, 0) + center; - lastMax = tcrop((int)pmax, 0, trackWidth / 2 - 1) + center; bool scrub = m_viewer->isScrubHighlighted(row, col); @@ -1522,7 +1519,6 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { pmin = minmax.first; pmax = minmax.second; - center = trackBounds.middle(); min = tcrop((int)pmin, -trackWidth / 2, 0) + center; max = tcrop((int)pmax, 0, trackWidth / 2 - 1) + center; @@ -1542,14 +1538,9 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { if (!o->isVerticalTimeline() || i != begin) { // "audio track" in the middle of the column p.setPen(m_viewer->getSoundColumnTrackColor()); - QLine minLine = o->horizontalLine(i, NumberRange(lastMin, min)); - p.drawLine(minLine); - QLine maxLine = o->horizontalLine(i, NumberRange(lastMax, max)); - p.drawLine(maxLine); + QLine midLine = o->horizontalLine(i, NumberRange(min, max)); + p.drawLine(midLine); } - - lastMin = min; - lastMax = max; } // yellow clipped border