A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
public static void drawImage(Canvas canvas,
Drawable drawable,
int x, int y,
int width, int height) {
MPPointF drawOffset = MPPointF.getInstance();
drawOffset.x = x - (width / 2);
drawOffset.y = y - (height / 2);
drawable.copyBounds(mDrawableBoundsCache);
drawable.setBounds(
mDrawableBoundsCache.left,
mDrawableBoundsCache.top,
mDrawableBoundsCache.left + width,
mDrawableBoundsCache.top + width);
int saveId = canvas.save();
// translate to the correct position and draw
canvas.translate(drawOffset.x, drawOffset.y);
drawable.draw(canvas);
canvas.restoreToCount(saveId);
}
should change to (width -> height)
public static void drawImage(Canvas canvas,
Drawable drawable,
int x, int y,
int width, int height) {
MPPointF drawOffset = MPPointF.getInstance();
drawOffset.x = x - (width / 2);
drawOffset.y = y - (height / 2);
drawable.copyBounds(mDrawableBoundsCache);
drawable.setBounds(
mDrawableBoundsCache.left,
mDrawableBoundsCache.top,
mDrawableBoundsCache.left + width,
mDrawableBoundsCache.top + height);
int saveId = canvas.save();
// translate to the correct position and draw
canvas.translate(drawOffset.x, drawOffset.y);
drawable.draw(canvas);
canvas.restoreToCount(saveId);
}
should change to (width -> height)