mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 04:08:53 +01:00
vector: reduce allocations
This commit is contained in:
parent
e8e458802d
commit
cdb430b2a5
@ -557,12 +557,13 @@ func (p *Path) AppendVerticesAndIndicesForStroke(vertices []ebiten.Vertex, indic
|
|||||||
return vertices, indices
|
return vertices, indices
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rects [][4]point
|
||||||
for _, subpath := range p.ensureSubpaths() {
|
for _, subpath := range p.ensureSubpaths() {
|
||||||
if subpath.pointCount() < 2 {
|
if subpath.pointCount() < 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
var rects [][4]point
|
rects = rects[:0]
|
||||||
for i := 0; i < subpath.pointCount()-1; i++ {
|
for i := 0; i < subpath.pointCount()-1; i++ {
|
||||||
pt := subpath.points[i]
|
pt := subpath.points[i]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user