How Can I Detect a Click Near Corner of Widget

I’m trying to make a base class for resizable widgets. I want to detect clicks near corners of the widget. I’m using this to detect corner clicks:

If a corner click is detected, I start a timer function to resize the widget using this function:

It works, once. After a resize, I can no longer detect corner clicks.

I’ve probably made some simple mistake, or used the wrong size, but I can’t figure out what’s wrong.