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) {
|
public void setZoomLevel(int level, long centerTime) {
|
||||||
long oldScaleFactor=scaleFactor;
|
long oldScaleFactor=scaleFactor;
|
||||||
|
if(level<0) level = 0;
|
||||||
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
|
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.scaleFactor = (long) Math.pow(10, level/2);
|
this.scaleFactor = (long) Math.pow(10, level/2);
|
||||||
|
|
|
@ -180,9 +180,11 @@ public class WaveformViewer implements IWaveformViewer {
|
||||||
GC gc = e.gc;
|
GC gc = e.gc;
|
||||||
gc.setAlpha(128);
|
gc.setAlpha(128);
|
||||||
int minX = Math.min(start.x, end.x);
|
int minX = Math.min(start.x, end.x);
|
||||||
int maxX = Math.max(start.x, end.x);
|
int width = Math.max(start.x, end.x) - minX;
|
||||||
int width = maxX - minX;
|
Point origin = waveformCanvas.getOrigin();
|
||||||
gc.fillRectangle(minX, 0, width, e.height);
|
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