implemented panel snap and movement detection