From 84fb7279eb3bc6dbd083151e7dbe2bd3dcc76f80 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 18 Jul 2019 15:58:11 +0200 Subject: [PATCH] ui/draw: rename ImageOp.Img to Src To match widget.Image.Src field name. Signed-off-by: Elias Naur --- ui/app/internal/gpu/gpu.go | 2 +- ui/draw/draw.go | 6 +++--- ui/widget/image.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/app/internal/gpu/gpu.go b/ui/app/internal/gpu/gpu.go index cf17a456..c5cf3db6 100644 --- a/ui/app/internal/gpu/gpu.go +++ b/ui/app/internal/gpu/gpu.go @@ -699,7 +699,7 @@ loop: case ops.TypeImage: var op gdraw.ImageOp op.Decode(encOp.Data, encOp.Refs) - state.img = op.Img + state.img = op.Src state.imgRect = op.Rect case ops.TypeDraw: var op gdraw.DrawOp diff --git a/ui/draw/draw.go b/ui/draw/draw.go index f3215fc6..9967edcb 100644 --- a/ui/draw/draw.go +++ b/ui/draw/draw.go @@ -14,7 +14,7 @@ import ( ) type ImageOp struct { - Img image.Image + Src image.Image Rect image.Rectangle } @@ -34,7 +34,7 @@ func (i ImageOp) Add(o *ui.Ops) { bo.PutUint32(data[5:], uint32(i.Rect.Min.Y)) bo.PutUint32(data[9:], uint32(i.Rect.Max.X)) bo.PutUint32(data[13:], uint32(i.Rect.Max.Y)) - o.Write(data, i.Img) + o.Write(data, i.Src) } func (i *ImageOp) Decode(data []byte, refs []interface{}) { @@ -53,7 +53,7 @@ func (i *ImageOp) Decode(data []byte, refs []interface{}) { }, } *i = ImageOp{ - Img: refs[0].(image.Image), + Src: refs[0].(image.Image), Rect: sr, } } diff --git a/ui/widget/image.go b/ui/widget/image.go index 9f3a4252..57ba2b4a 100644 --- a/ui/widget/image.go +++ b/ui/widget/image.go @@ -45,7 +45,7 @@ func (im Image) Layout(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.D dr := f32.Rectangle{ Max: f32.Point{X: float32(d.X), Y: float32(d.Y)}, } - draw.ImageOp{Img: im.Src, Rect: im.Rect}.Add(ops) + draw.ImageOp{Src: im.Src, Rect: im.Rect}.Add(ops) draw.DrawOp{Rect: dr}.Add(ops) return layout.Dimens{Size: d, Baseline: d.Y} }