Skip to content

Commit f5a3bad

Browse files
committed
Update dependencies
- Push minimal go version to 1.21 - tdewolff/canvas compatibility updates
1 parent 905f629 commit f5a3bad

File tree

7 files changed

+113
-176
lines changed

7 files changed

+113
-176
lines changed

.github/workflows/build-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v2
2121
with:
22-
go-version: ^1.19
22+
go-version: ^1.21
2323

2424
- name: Check out code into the Go module directory
2525
uses: actions/checkout@v2

.github/workflows/build-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go
1313
uses: actions/setup-go@v2
1414
with:
15-
go-version: ^1.19
15+
go-version: ^1.21
1616

1717
- name: Check out code into the Go module directory
1818
uses: actions/checkout@v2

bin/stitch/entities.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ func (e Entities) Draw(destImage *image.RGBA) {
5858

5959
// Theoretically we would need to linearize imgRGBA first, but DefaultColorSpace assumes that the color space is linear already.
6060
r := rasterizer.FromImage(originImage, canvas.DPMM(1.0), canvas.DefaultColorSpace)
61-
c.Render(r)
61+
c.RenderTo(r)
6262
r.Close() // This just transforms the image's luminance curve back from linear into non linear.
6363
}

bin/stitch/entity.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
//var entityDisplayFontFace *canvas.FontFace
1616

1717
var entityDisplayAreaDamageStyle = canvas.Style{
18-
FillColor: color.RGBA{100, 0, 0, 100},
19-
StrokeColor: canvas.Transparent,
18+
Fill: canvas.Paint{Color: color.RGBA{100, 0, 0, 100}},
19+
Stroke: canvas.Paint{},
2020
StrokeWidth: 1.0,
2121
StrokeCapper: canvas.ButtCap,
2222
StrokeJoiner: canvas.MiterJoin,
@@ -26,8 +26,8 @@ var entityDisplayAreaDamageStyle = canvas.Style{
2626
}
2727

2828
var entityDisplayMaterialAreaCheckerStyle = canvas.Style{
29-
FillColor: color.RGBA{0, 0, 127, 127},
30-
StrokeColor: canvas.Transparent,
29+
Fill: canvas.Paint{Color: color.RGBA{0, 0, 127, 127}},
30+
Stroke: canvas.Paint{},
3131
StrokeWidth: 1.0,
3232
StrokeCapper: canvas.ButtCap,
3333
StrokeJoiner: canvas.MiterJoin,
@@ -37,8 +37,8 @@ var entityDisplayMaterialAreaCheckerStyle = canvas.Style{
3737
}
3838

3939
var entityDisplayTeleportStyle = canvas.Style{
40-
FillColor: color.RGBA{0, 127, 0, 127},
41-
StrokeColor: canvas.Transparent,
40+
Fill: canvas.Paint{Color: color.RGBA{0, 127, 0, 127}},
41+
Stroke: canvas.Paint{},
4242
StrokeWidth: 1.0,
4343
StrokeCapper: canvas.ButtCap,
4444
StrokeJoiner: canvas.MiterJoin,
@@ -48,8 +48,8 @@ var entityDisplayTeleportStyle = canvas.Style{
4848
}
4949

5050
var entityDisplayHitBoxStyle = canvas.Style{
51-
FillColor: color.RGBA{64, 64, 0, 64},
52-
StrokeColor: color.RGBA{0, 0, 0, 64},
51+
Fill: canvas.Paint{Color: color.RGBA{64, 64, 0, 64}},
52+
Stroke: canvas.Paint{Color: color.RGBA{0, 0, 0, 64}},
5353
StrokeWidth: 1.0,
5454
StrokeCapper: canvas.ButtCap,
5555
StrokeJoiner: canvas.MiterJoin,
@@ -59,8 +59,8 @@ var entityDisplayHitBoxStyle = canvas.Style{
5959
}
6060

6161
var entityDisplayCollisionTriggerStyle = canvas.Style{
62-
FillColor: color.RGBA{0, 64, 64, 64},
63-
StrokeColor: color.RGBA{0, 0, 0, 64},
62+
Fill: canvas.Paint{Color: color.RGBA{0, 64, 64, 64}},
63+
Stroke: canvas.Paint{Color: color.RGBA{0, 0, 0, 64}},
6464
StrokeWidth: 1.0,
6565
StrokeCapper: canvas.ButtCap,
6666
StrokeJoiner: canvas.MiterJoin,

bin/stitch/player-path.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
)
1818

1919
var playerPathDisplayStyle = canvas.Style{
20-
FillColor: canvas.Transparent,
21-
//StrokeColor: color.RGBA{0, 0, 0, 127},
20+
Fill: canvas.Paint{},
21+
//Stroke: canvas.Paint{Color: color.RGBA{0, 0, 0, 127}},
2222
StrokeWidth: 3.0,
2323
StrokeCapper: canvas.ButtCap,
2424
StrokeJoiner: canvas.MiterJoin,
@@ -81,13 +81,13 @@ func (p PlayerPath) Draw(destImage *image.RGBA) {
8181

8282
if pathElement.Polymorphed {
8383
// Set stroke color to typically polymorph color.
84-
ctx.Style.StrokeColor = color.RGBA{127, 50, 83, 127}
84+
ctx.Style.Stroke.Color = color.RGBA{127, 50, 83, 127}
8585
} else {
8686
// Set stroke color depending on HP level.
8787
hpFactor := math.Max(math.Min(pathElement.HP/pathElement.MaxHP, 1), 0)
8888
hpFactorInv := 1 - hpFactor
8989
r, g, b, a := uint8((0*hpFactor+1*hpFactorInv)*127), uint8((1*hpFactor+0*hpFactorInv)*127), uint8(0), uint8(127)
90-
ctx.Style.StrokeColor = color.RGBA{r, g, b, a}
90+
ctx.Style.Stroke.Color = color.RGBA{r, g, b, a}
9191
}
9292

9393
ctx.DrawPath(0, 0, path)
@@ -96,6 +96,6 @@ func (p PlayerPath) Draw(destImage *image.RGBA) {
9696

9797
// Theoretically we would need to linearize imgRGBA first, but DefaultColorSpace assumes that the color space is linear already.
9898
r := rasterizer.FromImage(originImage, canvas.DPMM(1.0), canvas.DefaultColorSpace)
99-
c.Render(r)
99+
c.RenderTo(r)
100100
r.Close() // This just transforms the image's luminance curve back from linear into non linear.
101101
}

go.mod

+26-25
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
module github.com/Dadido3/noita-mapcap
22

3-
go 1.19
3+
go 1.21
44

55
require (
66
github.com/1lann/promptui v0.8.1-0.20220708222609-81fad96dd5e1
7-
github.com/cheggaaa/pb/v3 v3.1.0
8-
github.com/coreos/go-semver v0.3.0
9-
github.com/kbinani/screenshot v0.0.0-20210720154843-7d3a670d8329
7+
github.com/cheggaaa/pb/v3 v3.1.4
8+
github.com/coreos/go-semver v0.3.1
9+
github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237
1010
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
11-
github.com/tdewolff/canvas v0.0.0-20220627195642-6566432f4b20
12-
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75
11+
github.com/tdewolff/canvas v0.0.0-20231218015800-2ad5075e9362
12+
golang.org/x/exp v0.0.0-20231219180239-dc181d75b848
1313
)
1414

1515
require (
1616
github.com/ByteArena/poly2tri-go v0.0.0-20170716161910-d102ad91854f // indirect
1717
github.com/VividCortex/ewma v1.2.0 // indirect
18-
github.com/adrg/strutil v0.3.0 // indirect
19-
github.com/adrg/sysfont v0.1.2 // indirect
20-
github.com/adrg/xdg v0.4.0 // indirect
21-
github.com/benoitkugler/textlayout v0.1.3 // indirect
22-
github.com/benoitkugler/textprocessing v0.0.2 // indirect
18+
github.com/benoitkugler/textlayout v0.3.0 // indirect
19+
github.com/benoitkugler/textprocessing v0.0.3 // indirect
2320
github.com/chzyer/readline v1.5.1 // indirect
2421
github.com/dsnet/compress v0.0.1 // indirect
25-
github.com/fatih/color v1.13.0 // indirect
26-
github.com/gen2brain/shm v0.0.0-20200228170931-49f9650110c5 // indirect
27-
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 // indirect
22+
github.com/fatih/color v1.16.0 // indirect
23+
github.com/gen2brain/shm v0.1.0 // indirect
24+
github.com/go-fonts/latin-modern v0.3.2 // indirect
25+
github.com/go-fonts/liberation v0.3.2 // indirect
26+
github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea // indirect
27+
github.com/go-text/typesetting v0.0.0-20231219150831-cc0073efdbb4 // indirect
2828
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
29-
github.com/jezek/xgb v0.0.0-20210312150743-0e0f116e1240 // indirect
29+
github.com/jezek/xgb v1.1.1 // indirect
3030
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
31-
github.com/mattn/go-colorable v0.1.12 // indirect
32-
github.com/mattn/go-isatty v0.0.14 // indirect
33-
github.com/mattn/go-runewidth v0.0.13 // indirect
34-
github.com/rivo/uniseg v0.2.0 // indirect
35-
github.com/tdewolff/minify/v2 v2.11.10 // indirect
36-
github.com/tdewolff/parse/v2 v2.6.0 // indirect
37-
golang.org/x/image v0.10.0 // indirect
38-
golang.org/x/sys v0.5.0 // indirect
39-
golang.org/x/text v0.11.0 // indirect
40-
gopkg.in/yaml.v2 v2.4.0 // indirect
31+
github.com/mattn/go-colorable v0.1.13 // indirect
32+
github.com/mattn/go-isatty v0.0.20 // indirect
33+
github.com/mattn/go-runewidth v0.0.15 // indirect
34+
github.com/rivo/uniseg v0.4.4 // indirect
35+
github.com/tdewolff/minify/v2 v2.20.10 // indirect
36+
github.com/tdewolff/parse/v2 v2.7.7 // indirect
37+
golang.org/x/image v0.14.0 // indirect
38+
golang.org/x/net v0.19.0 // indirect
39+
golang.org/x/sys v0.15.0 // indirect
40+
golang.org/x/text v0.14.0 // indirect
41+
star-tex.org/x/tex v0.4.0 // indirect
4142
)

0 commit comments

Comments
 (0)