all: fix typos (#21089)

This commit is contained in:
Turiiya 2024-03-25 11:18:27 +01:00 committed by GitHub
parent 9ad84ddc21
commit f77bb32044
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
193 changed files with 403 additions and 402 deletions

View file

@ -176,7 +176,7 @@ pub fn (ctx &Context) draw_text2(p DrawTextParams) {
bold: p.bold
mono: p.mono
italic: p.italic
}) // TODO perf once it's the only function to draw text
}) // TODO: perf once it's the only function to draw text
}
// draw_text draws the string in `text_` starting at top-left position `x`,`y`.
@ -197,7 +197,7 @@ pub fn (ctx &Context) draw_text(x int, y int, text_ string, cfg gx.TextCfg) {
eprintln('gg: draw_text(): font not initialized')
return
}
// text := text_.trim_space() // TODO remove/optimize
// text := text_.trim_space() // TODO: remove/optimize
// mut text := text_
// if text.contains('\t') {
// text = text.replace('\t', ' ')
@ -233,7 +233,7 @@ pub fn (ctx &Context) text_width(s string) int {
ctx.ft.fons.text_bounds(0, 0, s, &buf[0])
if s.ends_with(' ') {
return int((buf[2] - buf[0]) / ctx.scale) +
ctx.text_width('i') // TODO fix this in fontstash?
ctx.text_width('i') // TODO: fix this in fontstash?
}
res := int((buf[2] - buf[0]) / ctx.scale)
// println('TW "$s" = $res')