From 94351006a10ca22a783c366f898a3735ea66e52a Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Wed, 7 Oct 2020 21:27:30 -0700 Subject: [PATCH] Remove Application.ForceDraw --- CHANGELOG | 1 + FORK.md | 4 ++++ application.go | 12 ------------ box.go | 1 - 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 41bd9e8..4e6728b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ v1.5.1 (WIP) - Allow modification of scroll bar render text - Optimize TextView (writing is 90% faster, drawing is 50% faster) - Remove return values from methods which return their primitive (breaks chaining) +- Remove Application.ForceDraw (Application.Draw may be called anywhere) v1.5.0 (2020-10-03) - Add scroll bar to TextView diff --git a/FORK.md b/FORK.md index e148772..e6ed511 100644 --- a/FORK.md +++ b/FORK.md @@ -72,6 +72,10 @@ This greatly improves buffer efficiency. [TextView.Write](https://docs.rocketnin is 90% faster and [TextView.Draw](https://docs.rocketnine.space/gitlab.com/tslocum/cview/#TextView.Draw) is 50% faster. +## `Application.ForceDraw` has been removed + +`Application.Draw` may be called anywhere as it is thread-safe. + # Merged pull requests The following tview pull requests have been merged into cview: diff --git a/application.go b/application.go index 8477d2e..fb18f25 100644 --- a/application.go +++ b/application.go @@ -547,18 +547,6 @@ func (a *Application) Draw() { a.QueueUpdate(func() { a.draw() }) - -} - -// ForceDraw refreshes the screen immediately. Use this function with caution as -// it may lead to race conditions with updates to primitives in other -// goroutines. It is always preferrable to use Draw() instead. Never call this -// function from a goroutine. -// -// It is safe to call this function during queued updates and direct event -// handling. -func (a *Application) ForceDraw() { - a.draw() } // draw actually does what Draw() promises to do. diff --git a/box.go b/box.go index e027b14..728734a 100644 --- a/box.go +++ b/box.go @@ -392,7 +392,6 @@ func (b *Box) SetTitleAlign(align int) { defer b.l.Unlock() b.titleAlign = align - } // Draw draws this primitive onto the screen.