added semi-working re-sizing when the lines go outside the black preview box