android - View background not drawn correctly -
i'm trying create view draws background colour image on top of it. image should transformed matrix. background should not be.
the ondraw()
method looks this:
protected void ondraw(canvas canvas) { canvas.drawrect(0, 0, canvas.getwidth(), canvas.getheight(), paint); drawable drawable = getimagedrawable(); if (drawable == null) { return; } int count = canvas.save(); if (cliprect != null) { canvas.cliprect(cliprect); } canvas.concat(matrix); drawable.draw(canvas); canvas.restoretocount(count); }
on of devices i've tested on, background above , left of image not drawn correctly. see video here: https://youtu.be/rno2xxaenua you'll need pause video see what's going on.
this problem caused accidentally overriding view.getmatrix()
Comments
Post a Comment