1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gen: fix multiple call of expression in match (#6324)

This commit is contained in:
Enzo
2020-09-08 00:38:24 +02:00
committed by GitHub
parent 5258f52497
commit 18034bb95c
6 changed files with 56 additions and 37 deletions

View File

@@ -36,7 +36,10 @@ mut:
fn (mut a App) init() {
a.frame = 0
a.last = time.ticks()
a.ps = particle.System{width: a.width, height: a.height}
a.ps = particle.System{
width: a.width
height: a.height
}
a.ps.init(particle.SystemConfig{
pool: 20000
})
@@ -59,7 +62,6 @@ fn (mut a App) run() {
html5_canvas_name: title.str
cleanup_userdata_cb: cleanup
}
sapp.run(&desc)
}
@@ -119,13 +121,10 @@ fn event(ev &C.sapp_event, user_data voidptr) {
}
}
}
if ev.@type == .touches_began || ev.@type == .touches_moved {
if ev.num_touches > 0 {
touch_point := ev.touches[0]
app.ps.explode(touch_point.pos_x, touch_point.pos_y)
}
}
}