mirror of https://github.com/gdamore/tcell.git
fixes #647 Screen.Clear — Flickering on Windows
This commit is contained in:
parent
50882fce9f
commit
2917c3801e
|
@ -38,7 +38,6 @@ type cScreen struct {
|
||||||
curx int
|
curx int
|
||||||
cury int
|
cury int
|
||||||
style Style
|
style Style
|
||||||
clear bool
|
|
||||||
fini bool
|
fini bool
|
||||||
vten bool
|
vten bool
|
||||||
truecolor bool
|
truecolor bool
|
||||||
|
@ -972,11 +971,6 @@ func (s *cScreen) writeString(x, y int, style Style, ch []uint16) {
|
||||||
func (s *cScreen) draw() {
|
func (s *cScreen) draw() {
|
||||||
// allocate a scratch line bit enough for no combining chars.
|
// allocate a scratch line bit enough for no combining chars.
|
||||||
// if you have combining characters, you may pay for extra allocations.
|
// if you have combining characters, you may pay for extra allocations.
|
||||||
if s.clear {
|
|
||||||
s.clearScreen(s.style, s.vten)
|
|
||||||
s.clear = false
|
|
||||||
s.cells.Invalidate()
|
|
||||||
}
|
|
||||||
buf := make([]uint16, 0, s.w)
|
buf := make([]uint16, 0, s.w)
|
||||||
wcs := buf[:]
|
wcs := buf[:]
|
||||||
lstyle := styleInvalid
|
lstyle := styleInvalid
|
||||||
|
@ -1165,12 +1159,7 @@ func (s *cScreen) Clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *cScreen) Fill(r rune, style Style) {
|
func (s *cScreen) Fill(r rune, style Style) {
|
||||||
s.Lock()
|
s.cells.Fill(r, style)
|
||||||
if !s.fini {
|
|
||||||
s.cells.Fill(r, style)
|
|
||||||
s.clear = true
|
|
||||||
}
|
|
||||||
s.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *cScreen) clearScreen(style Style, vtEnable bool) {
|
func (s *cScreen) clearScreen(style Style, vtEnable bool) {
|
||||||
|
|
Loading…
Reference in New Issue