shithub: mycel

Download patch

ref: ba66a58b7772b1d28f90f103ee0f97415e20ef52
parent: 48f456d1bab800c0707427c9c12bc0657236d330
author: Philip Silva <philip.silva@protonmail.com>
date: Fri Feb 12 11:44:27 EST 2021

Improved svg handling

--- a/browser/browser.go
+++ b/browser/browser.go
@@ -139,6 +139,7 @@
 	var i *draw.Image
 	var cached bool
 	src := attr(*n.DomSubtree, "src")
+	log.Printf("newImage: src: %v", src)
 
 	if display == nil {
 		// probably called from a unit test
@@ -150,6 +151,7 @@
 		if  err != nil {
 			return nil, fmt.Errorf("serialize: %w", err)
 		}
+		log.Printf("newImage: xml: %v", xml)
 		buf, err := img.Svg(xml, n.Width(), n.Height())
 		if err == nil {
 			var err error
--- a/domino/domino.go
+++ b/domino/domino.go
@@ -417,7 +417,7 @@
 	for {
 		select {
 		case m := <-d.domChange:
-			log.Infof("mutation received @ %v for %v", m.Time, m.Sel)
+			log.Printf("mutation received @ %v for %v", m.Time, m.Sel)
 			changed = true
 		default:
 			break outer
@@ -565,12 +565,11 @@
 		Type: t,
 		Sel: q,
 	}
-	log.Infof("mutation received: %+v", m)
+	log.Printf("mutation received: %+v", m)
 	select {
 	case d.domChange <- m:
 	default:
-		// TODO: that's not supposed to happen
-		log.Errorf("dom changes backlog full")
+		log.Printf("dom changes backlog full")
 	}
 }
 
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,7 @@
 go 1.15
 
 replace 9fans.net/go v0.0.0-00010101000000-000000000000 => github.com/knusbaum/go v0.0.0-20200413212707-848f58a0ec6e
+replace github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 => github.com/psilva261/oksvg v0.0.0-20210212153200-941e54e245a3
 
 exclude github.com/aymerick/douceur v0.1.0
 
--- a/go.sum
+++ b/go.sum
@@ -30,6 +30,8 @@
 github.com/mjl-/duit v0.0.0-20200330125617-580cb0b2843f/go.mod h1:OlRagobzQ97GoM+WaQ5kyzdyts952BFYsuY5bMyv9tw=
 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
+github.com/psilva261/oksvg v0.0.0-20210212153200-941e54e245a3 h1:LiOcewq9fY3XoorTvhD4vF/s/YdA+paymQXI48RIolw=
+github.com/psilva261/oksvg v0.0.0-20210212153200-941e54e245a3/go.mod h1:rIYdSIGJXvMv8Qw3fNAiSMBurAP18jyln+wR3PI0qKo=
 github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 h1:HunZiaEKNGVdhTRQOVpMmj5MQnGnv+e8uZNu3xFLgyM=
 github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
 github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 h1:m59mIOBO4kfcNCEzJNy71UkeF4XIx2EVmL9KLwDQdmM=