React: Don't measure line height / char width when editor is hidden

Previously, if a property that affects line height was changed while the editor was hidden, an exception was thrown due to the line height being assigned to 0. This defers measurement until the editor is shown again.

Fixes #1998