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

vfmt: change all '$expr' to '${expr}' (#16428)

This commit is contained in:
yuyi
2022-11-15 21:53:13 +08:00
committed by GitHub
parent 56239b4a23
commit 017ace6ea7
859 changed files with 7156 additions and 7135 deletions

View File

@@ -52,11 +52,11 @@ fn on_frame(mut app App) {
start := math.tau * app.mouse.y / (win_width * app.gg.scale)
end := math.tau * app.mouse.x / (win_width * app.gg.scale)
segs := if app.sel == .segs { '[$app.segs]' } else { '$app.segs' }
app.gg.draw_text_def(10, 10, 'Segments: $segs')
segs := if app.sel == .segs { '[${app.segs}]' } else { '${app.segs}' }
app.gg.draw_text_def(10, 10, 'Segments: ${segs}')
app.gg.draw_text_def(250, 10, 'Drawing Angles (radians)')
app.gg.draw_text_def(200, 26, 'Start: $start°')
app.gg.draw_text_def(350, 26, 'End: $end°')
app.gg.draw_text_def(200, 26, 'Start: ${start}°')
app.gg.draw_text_def(350, 26, 'End: ${end}°')
mut x, mut y := 0, -80
y += 150

View File

@@ -7,7 +7,7 @@ import sokol.sapp
const (
max_files = 12
text = 'Drag&Drop here max $max_files files.'
text = 'Drag&Drop here max ${max_files} files.'
text_size = 16
)
@@ -62,7 +62,7 @@ fn frame(mut app App) {
mut y := 40
for c, f in app.dropped_file_list {
app.gg.draw_text(12, y, '[$c] $f', txt_conf)
app.gg.draw_text(12, y, '[${c}] ${f}', txt_conf)
y += text_size
}

View File

@@ -191,7 +191,7 @@ fn graphics_keydown(code gg.KeyCode, mod gg.Modifier, mut state AppState) {
// movement
mut d_x, mut d_y := 0.0, 0.0
if code == .enter {
println('> ViewRect{$state.view.x_min, $state.view.x_max, $state.view.y_min, $state.view.y_max}')
println('> ViewRect{${state.view.x_min}, ${state.view.x_max}, ${state.view.y_min}, ${state.view.y_max}}')
}
if state.gg.pressed_keys[int(gg.KeyCode.left)] {
d_x -= s_x

View File

@@ -77,7 +77,7 @@ fn frame(mut app App) {
app.counter += i64(f64(count) / time.second)
}
label := '$app.counter'
label := '${app.counter}'
label_width := (f64(label.len * text_cfg.size) / 4.0)
label_height := (f64(1 * text_cfg.size) / 2.0)
mut x := f32(size.width) * 0.5 - label_width