Skip to content

Commit bfe2caa

Browse files
author
Yatao Li
committed
prevent font overflow
1 parent b449461 commit bfe2caa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ui.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ module ui =
302302

303303
let RenderText (ctx: IDrawingContextImpl, region: Rect, scale: float, fg: SKPaint, bg: SKPaint, sp: SKPaint, underline: bool, undercurl: bool, text: string, useShaping: bool) =
304304

305+
ctx.PushClip(region)
305306
// DrawText accepts the coordinate of the baseline.
306307
// h = [padding space 1] + above baseline | below baseline + [padding space 2]
307308
let h = region.Bottom - region.Y
@@ -373,3 +374,5 @@ module ui =
373374
path.LineTo(px + q3f, py2)
374375
px <- px + ff
375376
skia.SkCanvas.DrawPath(path , sp)
377+
378+
ctx.PopClip()

0 commit comments

Comments
 (0)