@@ -174,8 +174,8 @@ protected override void OnPaint(PaintEventArgs e)
174174 Debug . Assert ( _left != 0 || _top != 0 ) ;
175175 Logger . Display . Verbose ( $ "ToolTipForm OnPaint: { _text . ToString ( ) } @ ({ _left } ,{ _top } )") ;
176176 const int leftPadding = 6 ;
177- const int linePadding = 2 ;
178- const int widthPadding = 10 ;
177+ const int linePadding = 0 ;
178+ const int widthPadding = 12 ;
179179 const int heightPadding = 2 ;
180180
181181 base . OnPaint ( e ) ;
@@ -195,7 +195,8 @@ protected override void OnPaint(PaintEventArgs e)
195195
196196 foreach ( var line in _text )
197197 {
198- int lineHeight = 0 ;
198+ totalHeight += linePadding ;
199+ int lineHeight = 12 ;
199200 foreach ( var run in line )
200201 {
201202 var font = _fonts [ run . Style ] ;
@@ -209,10 +210,9 @@ protected override void OnPaint(PaintEventArgs e)
209210 lineWidths . Add ( totalWidth ) ;
210211 totalWidth = 0 ;
211212 totalHeight += lineHeight ;
212- layoutRect = new Rectangle ( layoutLeft , layoutTop + totalHeight + linePadding , 1000 , 500 ) ;
213+ layoutRect = new Rectangle ( layoutLeft , layoutTop + totalHeight - 1 , 1000 , 500 ) ;
213214 }
214215 }
215-
216216 var width = lineWidths . Max ( ) + widthPadding ;
217217 var height = totalHeight + heightPadding ;
218218 SetBounds ( _left , _top , width , height ) ;
0 commit comments