Skip to content

Commit 45f06be

Browse files
deps: Formally replace gg. (#359)
This commit replaces the references in our codebase to import our version of gg. The risk of the previous method is other modules don't also make the override.
1 parent 003e726 commit 45f06be

26 files changed

+29
-31
lines changed

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ module tidbyt.dev/pixlet
22

33
go 1.19
44

5-
replace github.com/fogleman/gg => github.com/tidbyt/gg v0.0.0-20220808163829-95806fa1d427
6-
75
require (
86
github.com/antchfx/xmlquery v1.3.12
97
github.com/dustin/go-humanize v1.0.0
108
github.com/ericpauley/go-quantize v0.0.0-20200331213906-ae555eb2afa4
11-
github.com/fogleman/gg v1.3.0
129
github.com/fsnotify/fsnotify v1.5.4
1310
github.com/go-playground/validator/v10 v10.11.0
1411
github.com/google/pprof v0.0.0-20220729232143-a41b82acbcb1
@@ -24,6 +21,7 @@ require (
2421
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
2522
github.com/spf13/cobra v1.5.0
2623
github.com/stretchr/testify v1.8.0
24+
github.com/tidbyt/gg v0.0.0-20220808163829-95806fa1d427
2725
github.com/tidbyt/go-libwebp v0.0.0-20220802221933-1fabc3b46601
2826
github.com/vmihailenco/msgpack/v5 v5.3.5
2927
github.com/zachomedia/go-bdf v0.0.0-20220611021443-a3af701111be

render/animation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// Animations turns a list of children into an animation, where each

render/animation/positioned.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"image"
55
"math"
66

7-
"github.com/fogleman/gg"
7+
"github.com/tidbyt/gg"
88

99
"tidbyt.dev/pixlet/render"
1010
)

render/animation/rotate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package animation
22

33
import (
4-
"github.com/fogleman/gg"
4+
"github.com/tidbyt/gg"
55
)
66

77
// Transform by rotating by a given angle in degrees.

render/animation/scale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package animation
22

33
import (
4-
"github.com/fogleman/gg"
4+
"github.com/tidbyt/gg"
55
)
66

77
// Transform by scaling by a given factor.

render/animation/transform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package animation
22

33
import (
4-
"github.com/fogleman/gg"
4+
"github.com/tidbyt/gg"
55
)
66

77
type Transform interface {

render/animation/transformation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"image"
66
"sort"
77

8-
"github.com/fogleman/gg"
8+
"github.com/tidbyt/gg"
99

1010
"tidbyt.dev/pixlet/render"
1111
)

render/animation/translate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package animation
22

33
import (
4-
"github.com/fogleman/gg"
4+
"github.com/tidbyt/gg"
55
)
66

77
// Transform by translating by a given offset.

render/box.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"image"
55
"image/color"
66

7-
"github.com/fogleman/gg"
7+
"github.com/tidbyt/gg"
88
)
99

1010
// A Box is a rectangular widget that can hold a child widget.

render/circle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"image/color"
66
"math"
77

8-
"github.com/fogleman/gg"
8+
"github.com/tidbyt/gg"
99
)
1010

1111
// Circle draws a circle with the given `diameter` and `color`. If a

render/column.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// Column lays out and draws its children vertically (in a column).

render/image.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
_ "image/jpeg"
1313
_ "image/png"
1414

15-
"github.com/fogleman/gg"
1615
"github.com/nfnt/resize"
16+
"github.com/tidbyt/gg"
1717
"github.com/tidbyt/go-libwebp/webp"
1818
)
1919

@@ -84,11 +84,11 @@ func (p *Image) InitFromGIF(data []byte) error {
8484
}
8585

8686
p.Delay = img.Delay[0] * 10
87-
87+
8888
var prev_src *image.Paletted
8989
disposal_length := len(img.Disposal)
9090
compositing_op := draw.Src
91-
91+
9292
last := image.NewRGBA(image.Rect(0, 0, img.Config.Width, img.Config.Height))
9393

9494
for index, src := range img.Image {
@@ -105,7 +105,7 @@ func (p *Image) InitFromGIF(data []byte) error {
105105
// if this is a non-DisposalPrevious frame
106106
// and the next frame is DisposalPrevious
107107
// store the src to reset before the next frame draws
108-
if (!is_disposal_previous && index + 1 < disposal_length && img.Disposal[index+1] == gif.DisposalPrevious) {
108+
if !is_disposal_previous && index+1 < disposal_length && img.Disposal[index+1] == gif.DisposalPrevious {
109109
prev_src = src
110110
}
111111

render/marquee.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// Marquee scrolls its child horizontally or vertically.

render/padding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"image"
55
"image/color"
66

7-
"github.com/fogleman/gg"
7+
"github.com/tidbyt/gg"
88
)
99

1010
type Insets struct {

render/plot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"image/color"
66
"math"
77

8-
"github.com/fogleman/gg"
8+
"github.com/tidbyt/gg"
99
)
1010

1111
var DefaultPlotColor = color.RGBA{0xff, 0xff, 0xff, 0xff}

render/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"image/color"
66
"sync"
77

8-
"github.com/fogleman/gg"
8+
"github.com/tidbyt/gg"
99
)
1010

1111
const (

render/row.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// Row lays out and draws its children horizontally (in a row).

render/sequence.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// Sequence renders a list of child widgets in sequence.

render/stack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// Stack draws its children on top of each other.

render/starfield.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"math"
88
"math/rand"
99

10-
"github.com/fogleman/gg"
10+
"github.com/tidbyt/gg"
1111
)
1212

1313
type Starfield struct {

render/testutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"image/color"
77
"strings"
88

9-
"github.com/fogleman/gg"
9+
"github.com/tidbyt/gg"
1010
)
1111

1212
var DefaultPalette = map[string]color.RGBA{

render/text.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"image"
55
"image/color"
66

7-
"github.com/fogleman/gg"
7+
"github.com/tidbyt/gg"
88
)
99

1010
var (

render/tracer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"image"
55
"image/color"
66

7-
"github.com/fogleman/gg"
7+
"github.com/tidbyt/gg"
88
)
99

1010
type Tracer struct {

render/vector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// A vector draws its children either vertically or horizontally (like

render/widget.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package render
33
import (
44
"image"
55

6-
"github.com/fogleman/gg"
6+
"github.com/tidbyt/gg"
77
)
88

99
// A Widget is a self-contained object that can render itself as an image.

render/wrappedtext.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"image"
55
"image/color"
66

7-
"github.com/fogleman/gg"
7+
"github.com/tidbyt/gg"
88
)
99

1010
// WrappedText draws multi-line text.

0 commit comments

Comments
 (0)