Viewport Outline bug?

Are you regenerating the doc after the edits but before this node? If not, then the dimensions in this node are captured prior to the regeneation from the changes in content. Perhaps changing the doc.regenerate to happen before you get the size would help.