mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
parent
e42cff071c
commit
16b3a5c296
@ -205,7 +205,9 @@ func (i *Image) ReplacePixels(pix []byte) {
|
|||||||
delayedCommandsM.Lock()
|
delayedCommandsM.Lock()
|
||||||
if needsToDelayCommands {
|
if needsToDelayCommands {
|
||||||
delayedCommands = append(delayedCommands, func() {
|
delayedCommands = append(delayedCommands, func() {
|
||||||
i.img.ReplacePixels(pix)
|
copied := make([]byte, len(pix))
|
||||||
|
copy(copied, pix)
|
||||||
|
i.img.ReplacePixels(copied)
|
||||||
})
|
})
|
||||||
delayedCommandsM.Unlock()
|
delayedCommandsM.Unlock()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user