Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Sep 18, 2019
1 parent dd36c68 commit 0bee553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ViewModels/EditorViewModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ type EditorViewModel(GridId: int, ?parent: EditorViewModel, ?_gridsize: GridSize
sp <- GetReverseColor sp

if bg = m_default_bg then
bg <- Avalonia.Media.Color(0uy, bg.R, bg.G, bg.B)
bg <- Avalonia.Media.Color(200uy, bg.R, bg.G, bg.B)
fg, bg, sp, attrs


Expand Down Expand Up @@ -564,7 +564,7 @@ type EditorViewModel(GridId: int, ?parent: EditorViewModel, ?_gridsize: GridSize

member __.BackgroundBrush
with get(): SolidColorBrush =
SolidColorBrush(m_default_bg, 0.0)
SolidColorBrush(m_default_bg, 0.5)

member __.BufferHeight with get(): float = m_fb_h
member __.BufferWidth with get(): float = m_fb_w
Expand Down
8 changes: 3 additions & 5 deletions ui.fs
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ module ui =
fgpaint.TextEncoding <- SKTextEncoding.Utf16
()

let _clearColor = Avalonia.Media.Color(0uy, 0uy, 0uy, 0uy)

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

// don't clip all along. see #60
Expand All @@ -360,12 +358,12 @@ module ui =
//lol wat??
//fg.Shader <- SKShader.CreateCompose(SKShader.CreateColor(fg.Color), SKShader.CreatePerlinNoiseFractalNoise(0.1F, 0.1F, 1, 6.41613F))

if bg.Color.Alpha = 0uy then
if bg.Color.Alpha <> 0xFFuy then
let _clearColor = Avalonia.Media.Color(0uy, bg.Color.Red, bg.Color.Green, bg.Color.Blue)
skia.PushClip(region)
skia.Clear(_clearColor)
skia.PopClip()
else
skia.SkCanvas.DrawRect(region.ToSKRect(), bg)
skia.SkCanvas.DrawRect(region.ToSKRect(), bg)
if not <| String.IsNullOrWhiteSpace text then
if shaper.IsSome then
skia.SkCanvas.DrawShapedText(shaper.Value, text.TrimEnd(), single fontPos.X, single fontPos.Y, fg)
Expand Down

0 comments on commit 0bee553

Please sign in to comment.