Change addLineWidget to update scrollTop synchronously

Fix for #1153