Add a function to retrieve current brush extents.

I need this for an application I'm working on. However, this can also serve as a
starting point for fixing the brush resets on resize. I'll have a look at that
soon.

**NOTE**: I'll rebase this commit master before the merge and create a new pull request. I'm working on multiple fixes/features at the same time.