I am having trouble finding an answer to this. Consider the clipping code below:
boolean is_ok = mycanvas.clipRect(clip_left, clip_top, clip_right+1, clip_bottom+1);
mycanvas.getClipBounds(clipRect);
if (!is_ok ||
clipRect.left != clip_left ||
clipRect.top != clip_top ||
clipRect.right != clip_right+1 ||
clipRect.bottom != clip_bottom+1)
{
Log.i("DEBUG", "setClipping failed");
}
When the clip bounds are returned they don't match what was just set. For example if clip_left, clip_top, clip_right, clip_bottom are (100,50,109, 59) then I would expect the clipping bounds to be (100, 50, 110, 60) given the code above. It isn't. getClipBounds() returns (100, 51, 110, 60).
Why is top = 51 when I just set it to 50? There's something under the hood I don't understand yet.