diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/EleScroll.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/EleScroll.java index eedc1d4..8c6c363 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/EleScroll.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/EleScroll.java @@ -61,12 +61,17 @@ public class EleScroll extends View implements DrawOther, Choreographer.FrameCal public void drawOther(Canvas canvas) { if(img==null) return; if(effect=='l') { - canvas.drawBitmap(img, cur, 0, null); - canvas.drawBitmap(img, cur+img.getWidth(), 0, null); + var x = cur; + do { + canvas.drawBitmap(img, x, 0, null); + x += img.getWidth(); + } while(x < w); } else if(effect=='r') { - var x = cur-img.getWidth()+w; - canvas.drawBitmap(img, x, 0, null); - canvas.drawBitmap(img, x-img.getWidth(), 0, null); + var x = cur + w - img.getWidth(); + do { + canvas.drawBitmap(img, x, 0, null); + x -= img.getWidth(); + } while(x > -img.getWidth()); } else if(effect=='t') { canvas.drawBitmap(img, 0, cur, null); canvas.drawBitmap(img, 0, cur+img.getHeight(), null);