~gioverse/chat

a2a29f81c0135ead189f08add91da7b207fb19c3 — Chris Waldon 2 months ago 567f573
deps: update gio

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
5 files changed, 21 insertions(+), 22 deletions(-)

M go.mod
M go.sum
M layout/rounded.go
M ninepatch/ninepatch.go
M widget/material/image.go
M go.mod => go.mod +2 -2
@@ 3,8 3,8 @@ module git.sr.ht/~gioverse/chat
go 1.16

require (
	gioui.org v0.0.0-20210804105805-1efe68c1540b
	gioui.org/x v0.0.0-20210804152830-6815ab60d717
	gioui.org v0.0.0-20211026101311-1eab4b84a6d3
	gioui.org/x v0.0.0-20211102210401-cead9283b8ff
	github.com/drhodes/golorem v0.0.0-20160418191928-ecccc744c2d9
	github.com/lucasb-eyer/go-colorful v1.2.0
	github.com/pkg/profile v1.6.0

M go.sum => go.sum +10 -7
@@ 1,13 1,15 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210729070555-8cec7e04eb71/go.mod h1:N4QK6T0gTQc7ogB7rniAyYQb8/klqI6hQkqV+HAh5Mw=
gioui.org v0.0.0-20210804105805-1efe68c1540b h1:WoK7TEkeZdluAyzsuGnqod+/PTyrUVoF81Fyhsb4R/k=
gioui.org v0.0.0-20210804105805-1efe68c1540b/go.mod h1:N4QK6T0gTQc7ogB7rniAyYQb8/klqI6hQkqV+HAh5Mw=
gioui.org/cpu v0.0.0-20210727122813-41509bcd3462 h1:JZyB+d8tPExZHNZwMiGKeeAVd0mkFTc3Zsmegdn178M=
gioui.org/cpu v0.0.0-20210727122813-41509bcd3462/go.mod h1:DkhBDuHokSMOUxX5LZQ7IcxyJJzs3OON8Z5ojaXUXxo=
gioui.org/x v0.0.0-20210804152830-6815ab60d717 h1:iRI8QLSxwEkJJI+WdpMvUYNP3wavU5GVkijmmFzjLdo=
gioui.org/x v0.0.0-20210804152830-6815ab60d717/go.mod h1:+BOtudS1JLP5YKhna9BFi32SrO/Hm7IkBPjFQJQrn6g=
gioui.org v0.0.0-20211026101311-1eab4b84a6d3 h1:kgz+ANJMlCF5Qd9Rqu8Xu1CKl4asi9AKm440jnZgB8U=
gioui.org v0.0.0-20211026101311-1eab4b84a6d3/go.mod h1:yoWOxPng6WkDpsud+NRmkoftmyWn3rkKsYGEcWHpjTI=
gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 h1:AGDDxsJE1RpcXTAxPG2B4jrwVUJGFDjINIPi1jtO6pc=
gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
gioui.org/shader v1.0.6 h1:cvZmU+eODFR2545X+/8XucgZdTtEjR3QWW6W65b0q5Y=
gioui.org/shader v1.0.6/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
gioui.org/x v0.0.0-20211102210401-cead9283b8ff h1:hAKQjgj7vEgfU57xwS2QEC0lcdRBpjK8egdlHI0QNbg=
gioui.org/x v0.0.0-20211102210401-cead9283b8ff/go.mod h1:2SCbAJkcrS1ZQ8OlpswBRbDwOfLhKRPlSgz/HCpCXJA=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=


@@ 249,6 251,7 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=

M layout/rounded.go => layout/rounded.go +2 -3
@@ 16,15 16,14 @@ func (r Rounded) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
	macro := op.Record(gtx.Ops)
	dims := w(gtx)
	call := macro.Stop()
	defer op.Save(gtx.Ops).Load()
	radii := float32(gtx.Px(unit.Value(r)))
	clip.RRect{
	defer clip.RRect{
		Rect: layout.FRect(image.Rectangle{Max: dims.Size}),
		NE:   radii,
		NW:   radii,
		SW:   radii,
		SE:   radii,
	}.Add(gtx.Ops)
	}.Push(gtx.Ops).Pop()
	call.Add(gtx.Ops)
	return dims
}

M ninepatch/ninepatch.go => ninepatch/ninepatch.go +5 -7
@@ 54,30 54,28 @@ type Region struct {
// Layout the patch of the provided ImageOp described by the Region, scaling
// as needed.
func (r Region) Layout(gtx C, src paint.ImageOp) D {
	defer op.Save(gtx.Ops).Load()

	// Set the paint material to our source texture.
	src.Add(gtx.Ops)

	// If we need to scale the source image to cover the content area, do so:
	if r.Stretched.Size != r.Source.Size {
		op.Affine(f32.Affine2D{}.Scale(layout.FPt(r.Stretched.Offset), f32.Point{
		defer op.Affine(f32.Affine2D{}.Scale(layout.FPt(r.Stretched.Offset), f32.Point{
			X: float32(r.Stretched.Size.X) / float32(r.Source.Size.X),
			Y: float32(r.Stretched.Size.Y) / float32(r.Source.Size.Y),
		})).Add(gtx.Ops)
		})).Push(gtx.Ops).Pop()
	}

	// Shift layout to the origin of the region that we are covering, but compensate
	// for the fact that we're going to be reaching to an arbitrary point in the
	// source image. This logic aligns the origin of the important region of the
	// source image with the origin of the region that we're laying out.
	op.Offset(layout.FPt(r.Stretched.Offset.Sub(r.Source.Offset))).Add(gtx.Ops)
	defer op.Offset(layout.FPt(r.Stretched.Offset.Sub(r.Source.Offset))).Push(gtx.Ops).Pop()

	// Clip the scaled image to the bounds of the area we need to cover.
	clip.Rect(image.Rectangle{
	defer clip.Rect(image.Rectangle{
		Min: r.Source.Offset,
		Max: r.Source.Size.Add(r.Source.Offset),
	}).Add(gtx.Ops)
	}).Push(gtx.Ops).Pop()

	// Paint the scaled, clipped image.
	paint.PaintOp{}.Add(gtx.Ops)

M widget/material/image.go => widget/material/image.go +2 -3
@@ 34,15 34,14 @@ func (img Image) Layout(gtx layout.Context) layout.Dimensions {
	if img.Image.Src == (paint.ImageOp{}) {
		return D{Size: gtx.Constraints.Max}
	}
	defer op.Save(gtx.Ops).Load()
	macro := op.Record(gtx.Ops)
	dims := img.Image.Layout(gtx)
	call := macro.Stop()
	r := float32(gtx.Px(img.Radii))
	clip.RRect{
	defer clip.RRect{
		Rect: f32.Rectangle{Max: layout.FPt(dims.Size)},
		NE:   r, NW: r, SE: r, SW: r,
	}.Add(gtx.Ops)
	}.Push(gtx.Ops).Pop()
	call.Add(gtx.Ops)
	return dims
}