@@ -211,42 +211,42 @@ public CachingGlyphRenderer(MemoryAllocator memoryAllocator, int size, TextDrawi
211211
212212 public void BeginFigure ( ) => this . builder . StartFigure ( ) ;
213213
214- public TextDecoration EnabledDecorations ( )
214+ public TextDecorations EnabledDecorations ( )
215215 {
216- var decorations = this . currentTextRun . TextDecorations ;
216+ TextDecorations decorations = this . currentTextRun . TextDecorations ;
217217 if ( this . currentTextRun is TextDrawingRun drawingRun )
218218 {
219219 if ( drawingRun . UnderlinePen != null )
220220 {
221- decorations |= TextDecoration . Underline ;
221+ decorations |= TextDecorations . Underline ;
222222 }
223223
224224 if ( drawingRun . StrikeoutPen != null )
225225 {
226- decorations |= TextDecoration . Strikeout ;
226+ decorations |= TextDecorations . Strikeout ;
227227 }
228228
229229 if ( drawingRun . OverlinePen != null )
230230 {
231- decorations |= TextDecoration . Overline ;
231+ decorations |= TextDecorations . Overline ;
232232 }
233233 }
234234
235235 return decorations ;
236236 }
237237
238- public void SetDecoration ( TextDecoration textDecoration , Vector2 start , Vector2 end , float thickness )
238+ public void SetDecoration ( TextDecorations textDecorations , Vector2 start , Vector2 end , float thickness )
239239 {
240- ref var targetDecoration = ref this . currentStrikout ;
241- if ( textDecoration == TextDecoration . Strikeout )
240+ ref TextDecorationDetails ? targetDecoration = ref this . currentStrikout ;
241+ if ( textDecorations == TextDecorations . Strikeout )
242242 {
243243 targetDecoration = ref this . currentStrikout ;
244244 }
245- else if ( textDecoration == TextDecoration . Underline )
245+ else if ( textDecorations == TextDecorations . Underline )
246246 {
247247 targetDecoration = ref this . currentUnderline ;
248248 }
249- else if ( textDecoration == TextDecoration . Overline )
249+ else if ( textDecorations == TextDecorations . Overline )
250250 {
251251 targetDecoration = ref this . currentOverline ;
252252 }
@@ -258,20 +258,21 @@ public void SetDecoration(TextDecoration textDecoration, Vector2 start, Vector2
258258 IPen pen = null ;
259259 if ( this . currentTextRun is TextDrawingRun drawingRun )
260260 {
261- if ( textDecoration == TextDecoration . Strikeout )
261+ if ( textDecorations == TextDecorations . Strikeout )
262262 {
263263 pen = drawingRun . StrikeoutPen ?? pen ;
264264 }
265- else if ( textDecoration == TextDecoration . Underline )
265+ else if ( textDecorations == TextDecorations . Underline )
266266 {
267267 pen = drawingRun . UnderlinePen ?? pen ;
268268 }
269- else if ( textDecoration == TextDecoration . Overline )
269+ else if ( textDecorations == TextDecorations . Overline )
270270 {
271271 pen = drawingRun . OverlinePen ;
272272 }
273273 }
274274
275+ // TODO:Isn't this already handled in font via GetEnds?
275276 //fix up the thickness/Y position so that the line render nicly
276277 var thicknessOffset = new Vector2 ( 0 , thickness * .5f ) ;
277278 var tl = start - thicknessOffset ;
0 commit comments