RichTextBox: Cache dpi
commit1821cc8adfd3e1dc135c9dd7cb40f86a3058e96b
authorKarl <karl@scowencomputers.co.nz>
Thu, 10 Sep 2015 04:37:57 +0000 (10 16:37 +1200)
committerKarl <karl@scowencomputers.co.nz>
Mon, 13 Jan 2020 03:42:44 +0000 (13 16:42 +1300)
tree6c1b99153ceba09d97bc9d7dd3315cfc4a166c0b
parentbe446f04f34b6ad1ff53e67eee0e4aa08f072dfc
RichTextBox: Cache dpi

The dpi isn't likely to change during the lifetime of the object, so is relatively safe to cache.
Creating a Graphics object each time the dpi is wanted when reading RTF is also rather silly performance-wise.
Even worse, when generating RTF it can cause a recalc, which can mean that some lines <= end_line don't exist.
mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs