From 0bee55382bc4f32de870eeff6c692a015c24762a Mon Sep 17 00:00:00 2001 From: Yatao Li Date: Wed, 18 Sep 2019 11:55:11 +0800 Subject: [PATCH] ... --- ViewModels/EditorViewModel.fs | 4 ++-- ui.fs | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ViewModels/EditorViewModel.fs b/ViewModels/EditorViewModel.fs index fa69387..fde01e6 100644 --- a/ViewModels/EditorViewModel.fs +++ b/ViewModels/EditorViewModel.fs @@ -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 @@ -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 diff --git a/ui.fs b/ui.fs index 28064d3..4a6fcaf 100644 --- a/ui.fs +++ b/ui.fs @@ -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 @@ -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)