I 'm writing a Visual Studio extension where I'm creating line adornments that need to be resized when the user resizes the code view. I.e. when the user resizes Visual Studio's window width, I modify both the adornment's width and height. I'm handling the IWpfTextView.LayoutChanged
event and I am resizing my adornments there. To avoid overlapping the adornments with the lines below it, I also implemented ILineTransformSource.GetLineTransform to enlarge the line's height to accommodate the size of the adornment.
However, when I change the dimensions of the adornments (when handling the IWpfTextView.LayoutChanged
event) I'm not getting calls to my ILineTransformSource.GetLineTransform function to resize the line transform. This leaves the adornment overlapping the lines below it. I can't seem to find any way of forcing a call to ILineTransformSource.GetLineTransform
. (Although, if the user scrolls the view, I do get these calls. But, I don't want to have to force the user to scroll the window to fix a visual glitch.)
Does anyone know of a way to force Visual Studio to call my ILineTransformSource.GetLineTransform
so that I can resize the line transforms when my adornments change height?
Try calling the IWpfTextView.DisplayTextLineContainingBufferPosition method - this will force GetLineTransform calls as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With