fix drag-zoom visual
This commit is contained in:
parent
f5a4e3c39e
commit
e87e1791c3
@ -235,6 +235,7 @@ public class WaveformCanvas extends Canvas{
|
||||
|
||||
public void setZoomLevel(int level, long centerTime) {
|
||||
long oldScaleFactor=scaleFactor;
|
||||
if(level<0) level = 0;
|
||||
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
|
||||
this.level = level;
|
||||
this.scaleFactor = (long) Math.pow(10, level/2);
|
||||
|
@ -180,9 +180,11 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
GC gc = e.gc;
|
||||
gc.setAlpha(128);
|
||||
int minX = Math.min(start.x, end.x);
|
||||
int maxX = Math.max(start.x, end.x);
|
||||
int width = maxX - minX;
|
||||
gc.fillRectangle(minX, 0, width, e.height);
|
||||
int width = Math.max(start.x, end.x) - minX;
|
||||
Point origin = waveformCanvas.getOrigin();
|
||||
int y_top = waveformCanvas.getRulerHeight()- origin.y;
|
||||
int y_bottom = waveformCanvas.getSize().y;
|
||||
gc.fillRectangle(minX, y_top, width,y_bottom);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user