Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/main/java/org/androidsoft/coloring/util/DrawUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ public static void convertSizeClip(Bitmap src, Bitmap dest) {
RectF srcRect = new RectF(0, 0, src.getWidth(), src.getHeight());
RectF destRect = new RectF(0, 0, dest.getWidth(), dest.getHeight());

// Because the current SDK does not directly support the "dest fits
// inside src" mode, we calculate the reverse matrix and invert to
// get what we want.
Matrix mDestSrc = new Matrix();
mDestSrc.setRectToRect(destRect, srcRect, Matrix.ScaleToFit.CENTER);
Matrix mSrcDest = new Matrix();
mDestSrc.invert(mSrcDest);

mSrcDest.setRectToRect(srcRect, destRect, Matrix.ScaleToFit.CENTER);
canvas.drawBitmap(src, mSrcDest, new Paint(Paint.DITHER_FLAG));
}

Expand Down