fmt: fix alignment of struct init fields (#22025)

This commit is contained in:
yuyi 2024-08-11 14:11:24 +08:00 committed by GitHub
parent 99da5726db
commit c51d30bf53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
671 changed files with 18817 additions and 18787 deletions

View file

@ -152,10 +152,10 @@ fn on_frame(mut app App) {
// drawing top
app.gg.draw_rect(0, 0, canvas_size, top_height, gx.black)
app.gg.draw_text(350, top_height / 2, 'Score: ${app.score}', gx.TextCfg{
color: gx.white
align: .center
color: gx.white
align: .center
vertical_align: .middle
size: 80
size: 80
})
// checking if snake bit itself
@ -179,15 +179,15 @@ fn main() {
app.reset_game()
app.gg = gg.new_context(
bg_color: gx.white
frame_fn: on_frame
keydown_fn: on_keydown
user_data: &app
width: canvas_size
height: top_height + canvas_size
create_window: true
resizable: false
window_title: 'snek'
bg_color: gx.white
frame_fn: on_frame
keydown_fn: on_keydown
user_data: &app
width: canvas_size
height: top_height + canvas_size
create_window: true
resizable: false
window_title: 'snek'
html5_canvas_name: 'canvas'
)

View file

@ -140,16 +140,16 @@ fn on_frame(mut app App) {
// draw score bar
app.gg.draw_rect_filled(0, 0, canvas_size, top_height, gx.black)
app.gg.draw_text(150, top_height / 2, 'Score: ${app.score}', gx.TextCfg{
color: gx.white
align: .center
color: gx.white
align: .center
vertical_align: .middle
size: 65
size: 65
})
app.gg.draw_text(canvas_size - 150, top_height / 2, 'Best: ${app.best}', gx.TextCfg{
color: gx.white
align: .center
color: gx.white
align: .center
vertical_align: .middle
size: 65
size: 65
})
if progress == 1 {
@ -200,15 +200,15 @@ fn main() {
}
app.gg = gg.new_context(
bg_color: gx.white
frame_fn: on_frame
keydown_fn: on_keydown
user_data: &app
width: canvas_size
height: top_height + canvas_size
create_window: true
resizable: false
window_title: 'snek'
bg_color: gx.white
frame_fn: on_frame
keydown_fn: on_keydown
user_data: &app
width: canvas_size
height: top_height + canvas_size
create_window: true
resizable: false
window_title: 'snek'
font_bytes_normal: font_bytes
)