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

View File

@ -251,7 +251,7 @@ public:
void SetSplitLineMode(wxSize size=wxSize(-1,-1)); void SetSplitLineMode(wxSize size=wxSize(-1,-1));
void CommitText(bool weak=false); 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 UpdateGlobals();
void SetToLine(int n,bool weak=false); void SetToLine(int n,bool weak=false);
void UpdateFrameTiming(); void UpdateFrameTiming();

View File

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