these should be single line if's, also you should use `+=` syntax

```js
if (delta.left) offset.left += delta.left
else offset.top += delta.top
```