AndroidScrollingImageView icon indicating copy to clipboard operation
AndroidScrollingImageView copied to clipboard

How to scroll perfectly diagonally??

Open ghost opened this issue 6 years ago • 0 comments

while (offset <= -getBitmap(arrayIndex).getHeight()) { offset += getBitmap(arrayIndex).getHeight(); arrayIndex = (arrayIndex + 1) % scene.length; }

        float start = offset;
        for (int i = 0; start < clipBounds.height(); i++) {
            Bitmap bitmap = getBitmap((arrayIndex + i) % scene.length);
            int width = bitmap.getWidth();
            int height = bitmap.getHeight();
            canvas.drawBitmap(bitmap, getBitmapLeft(width, start), getBitmapTop(height, start), null);
            start += width;
        }

        if (isStarted && speed != 0) {
            offset -= abs(speed);
            postInvalidateOnAnimation();
        }

ghost avatar Jun 30 '19 17:06 ghost