improve for resize window + support for left, right, top, bottom