Skip to content

Commit

Permalink
prevent font overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Aug 5, 2019
1 parent b449461 commit bfe2caa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui.fs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ module ui =

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

ctx.PushClip(region)
// DrawText accepts the coordinate of the baseline.
// h = [padding space 1] + above baseline | below baseline + [padding space 2]
let h = region.Bottom - region.Y
Expand Down Expand Up @@ -373,3 +374,5 @@ module ui =
path.LineTo(px + q3f, py2)
px <- px + ff
skia.SkCanvas.DrawPath(path , sp)

ctx.PopClip()

0 comments on commit bfe2caa

Please sign in to comment.