mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
all: clean up code, upgrade to modern Go
Signed-off-by: ddkwork
This commit is contained in:
+2
-2
@@ -356,7 +356,7 @@ func (s *shaperImpl) splitBidi(input shaping.Input) []shaping.Input {
|
||||
if err != nil {
|
||||
return []shaping.Input{input}
|
||||
}
|
||||
for i := 0; i < out.NumRuns(); i++ {
|
||||
for i := range out.NumRuns() {
|
||||
currentInput := input
|
||||
run := out.Run(i)
|
||||
dir := run.Direction()
|
||||
@@ -685,7 +685,7 @@ func (s *shaperImpl) Shape(pathOps *op.Ops, gs []Glyph) clip.PathSpec {
|
||||
nargs = 3
|
||||
}
|
||||
var args [3]f32.Point
|
||||
for i := 0; i < nargs; i++ {
|
||||
for i := range nargs {
|
||||
a := f32.Point{
|
||||
X: fseg.Args[i].X * scaleFactor,
|
||||
Y: -fseg.Args[i].Y * scaleFactor,
|
||||
|
||||
+2
-3
@@ -126,7 +126,8 @@ func TestShapingAlignWidth(t *testing.T) {
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
lines := shaper.LayoutString(Parameters{PxPerEm: ppem,
|
||||
lines := shaper.LayoutString(Parameters{
|
||||
PxPerEm: ppem,
|
||||
MinWidth: tc.minWidth,
|
||||
MaxWidth: tc.maxWidth,
|
||||
Locale: english,
|
||||
@@ -174,7 +175,6 @@ func TestNewlineSynthesis(t *testing.T) {
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
||||
doc := shaper.LayoutRunes(Parameters{
|
||||
PxPerEm: ppem,
|
||||
MaxWidth: 200,
|
||||
@@ -207,7 +207,6 @@ func TestNewlineSynthesis(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// simpleGlyph returns a simple square glyph with the provided cluster
|
||||
|
||||
+2
-2
@@ -35,10 +35,10 @@ func TestPathLRU(t *testing.T) {
|
||||
}
|
||||
|
||||
func testLRU(t *testing.T, put func(i int), get func(i int) bool) {
|
||||
for i := 0; i < maxSize; i++ {
|
||||
for i := range maxSize {
|
||||
put(i)
|
||||
}
|
||||
for i := 0; i < maxSize; i++ {
|
||||
for i := range maxSize {
|
||||
if !get(i) {
|
||||
t.Fatalf("key %d was evicted", i)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user