Skip to content

Commit

Permalink
预修复SurferView慢速越慢duration配置越无效的神奇bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Jul 26, 2020
1 parent 24be059 commit 11aceb6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/extensions/wavesurfer.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ fn.prototype=WaveSurferView.prototype={
//计算绘制占用长度
var pcmDuration=pcmData.length*1000/sampleRate;
var pcmWidth=pcmDuration*width/set.duration;
var pointCount=Math.max(1,Math.floor(pcmWidth/lineWidth));
pcmWidth+=This.drawLoss||0;
var pointCount=0;
if(pcmWidth<lineWidth){
This.drawLoss=pcmWidth;
//pointCount=0; 不够一根不绘制
}else{
This.drawLoss=0;
pointCount=Math.floor(pcmWidth/lineWidth);
};

//***后台卷轴连续绘制***
var linear1=This.genLinear(ctx,set.linear,originY,originY-heightY);//上半部分的填充
Expand Down

0 comments on commit 11aceb6

Please sign in to comment.