Esempio n. 1
0
// tabDelta returns the difference between the current font's measurement
// of a tab character and the actual tab size based on spaces times the
// code editor's tab width.
func (l *CodeEditorLine) tabDelta(font gxui.Font) int {
	tabWidth := font.Measure(&gxui.TextBlock{Runes: []rune{'\t'}}).W
	spaceWidth := font.Measure(&gxui.TextBlock{Runes: []rune{' '}}).W
	return spaceWidth*l.ce.TabWidth() - tabWidth
}