shithub: mycel

Download patch

ref: cfb823e911e3a63f0a2fd3e10e4f6be8dc16a327
parent: 2883e0082c123a335ccfc8756dcc2e2857f8db8c
author: Philip Silva <philip.silva@protonmail.com>
date: Sun Jun 6 05:52:50 EDT 2021

Prevent blurry texts after mouse hover

--- a/browser/browser.go
+++ b/browser/browser.go
@@ -32,8 +32,10 @@
 )
 
 const debugPrintHtml = false
-
 const EnterKey = 10
+// alwaysForceDraw to prevent blurry text after mouse
+// hovering
+const alwaysForceDraw = true
 
 var cursor = [16*2]uint8{
 	0b11111111, 0b11111110,
@@ -396,6 +398,7 @@
 	if el == nil {
 		return
 	}
+	force = alwaysForceDraw
 	// It would be possible to avoid flickers under certain circumstances
 	// of overlapping elements but the load for this is high:
 	// if self.Draw == duit.DirtyKid {
--- a/browser/grid.go
+++ b/browser/grid.go
@@ -177,6 +177,7 @@
 }
 
 func (ui *Grid) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, force bool) {
+	force = alwaysForceDraw
 	duit.KidsDraw(dui, self, ui.Kids, ui.size, ui.Background, img, orig, m, force)
 }