Fix entity sorting
This commit is contained in:
parent
022a12ce31
commit
8aa5187e2e
|
@ -59,8 +59,8 @@ func SortEntities(entities []*client.TextEntity) []*client.TextEntity {
|
||||||
copy(sortedEntities, entities)
|
copy(sortedEntities, entities)
|
||||||
|
|
||||||
sort.Slice(sortedEntities, func(i int, j int) bool {
|
sort.Slice(sortedEntities, func(i int, j int) bool {
|
||||||
entity1 := entities[i]
|
entity1 := sortedEntities[i]
|
||||||
entity2 := entities[j]
|
entity2 := sortedEntities[j]
|
||||||
if entity1.Offset < entity2.Offset {
|
if entity1.Offset < entity2.Offset {
|
||||||
return true
|
return true
|
||||||
} else if entity1.Offset == entity2.Offset {
|
} else if entity1.Offset == entity2.Offset {
|
||||||
|
|
Loading…
Reference in a new issue