Eliminate a redundant rerender of the frame when committing changes from

the visual tools. Makes all visual tools roughly twice as fast when real
time mode is enabled.

Originally committed to SVN as r4365.
This commit is contained in:
Thomas Goyne 2010-05-26 22:09:00 +00:00
parent e120ecc190
commit 6df5d97568
3 changed files with 4 additions and 4 deletions

View file

@ -264,7 +264,7 @@ void SubsEditBox::SetSplitLineMode(wxSize newSize) {
/// @param timeOnly
/// @param weak
///
void SubsEditBox::Update (bool timeOnly,bool weak) {
void SubsEditBox::Update (bool timeOnly,bool weak,bool video) {
if (enabled) {
AssDialogue *curdiag = grid->GetDialogue(linen);
if (curdiag) {
@ -300,7 +300,7 @@ void SubsEditBox::Update (bool timeOnly,bool weak) {
// Video
VideoContext::Get()->curLine = curdiag;
VideoContext::Get()->UpdateDisplays(false);
if (video) VideoContext::Get()->UpdateDisplays(false);
TextEdit->EmptyUndoBuffer();
}

View file

@ -251,7 +251,7 @@ public:
void SetSplitLineMode(wxSize size=wxSize(-1,-1));
void CommitText(bool weak=false);
void Update(bool timeOnly=false,bool weak=false);
void Update(bool timeOnly=false,bool weak=false,bool video=true);
void UpdateGlobals();
void SetToLine(int n,bool weak=false);
void UpdateFrameTiming();

View file

@ -266,7 +266,7 @@ void VisualTool<FeatureType>::Commit(bool full, wxString message) {
grid->ass->FlagAsModified(message);
}
grid->CommitChanges(false,!full);
grid->editBox->Update(false, true);
grid->editBox->Update(false, true, false);
}
template<class FeatureType>