Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Redraw Audio Waveform

Kiteb704484ecb85
diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp
index 15eedd12f..6e8fbf1f6 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