const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;