fix #1178 multiple issues when dragging within a parent container that is scrollable

Why is this necessary? In which case does `getGeometry` return a null value at this line?