Fix problem in widget-preserving line redraws

Issue #1645