- removed some unnecessary full refreshes

Sun, 29 Dec 2013 16:24:41 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 29 Dec 2013 16:24:41 +0200
changeset 594
d9feccafcbf7
parent 593
108d7d21e155
child 595
b6b39c1721a1

- removed some unnecessary full refreshes

src/addObjectDialog.cc file | annotate | diff | comparison | revisions
src/history.cc file | annotate | diff | comparison | revisions
--- a/src/addObjectDialog.cc	Mon Dec 23 16:29:44 2013 +0200
+++ b/src/addObjectDialog.cc	Sun Dec 29 16:24:41 2013 +0200
@@ -401,5 +401,5 @@
 		getCurrentDocument()->insertObj (idx, obj);
 	}
 
-	g_win->doFullRefresh();
+	g_win->refresh();
 }
--- a/src/history.cc	Mon Dec 23 16:29:44 2013 +0200
+++ b/src/history.cc	Sun Dec 29 16:24:41 2013 +0200
@@ -23,8 +23,6 @@
 #include "gui.h"
 #include "gldraw.h"
 
-bool g_fullRefresh = false;
-
 // =============================================================================
 // -----------------------------------------------------------------------------
 History::History() :
@@ -40,7 +38,6 @@
 	setIgnoring (true);
 
 	const Changeset& set = getChangeset (getPosition());
-	g_fullRefresh = false;
 
 	// Iterate the list in reverse and undo all actions
 	for (int i = set.size() - 1; i >= 0; --i)
@@ -49,12 +46,7 @@
 	}
 
 	decreasePosition();
-
-	if (!g_fullRefresh)
-		g_win->refresh();
-	else
-		g_win->doFullRefresh();
-
+	g_win->refresh();
 	g_win->updateActions();
 	dlog ("Position is now %1", getPosition());
 	setIgnoring (false);
@@ -68,19 +60,13 @@
 
 	setIgnoring (true);
 	const Changeset& set = getChangeset (getPosition() + 1);
-	g_fullRefresh = false;
 
 	// Redo things - in the order as they were done in the first place
 	for (const AbstractHistoryEntry* change : set)
 		change->redo();
 
 	setPosition (getPosition() + 1);
-
-	if (!g_fullRefresh)
-		g_win->refresh();
-	else
-		g_win->doFullRefresh();
-
+	g_win->refresh();
 	g_win->updateActions();
 	dlog ("Position is now %1", getPosition());
 	setIgnoring (false);
@@ -137,7 +123,6 @@
 void AddHistory::undo() const
 {	LDObject* obj = getParent()->getFile()->getObject (getIndex());
 	obj->deleteSelf();
-	g_fullRefresh = true;
 }
 
 // =============================================================================
@@ -168,7 +153,6 @@
 void DelHistory::redo() const
 {	LDObject* obj = getParent()->getFile()->getObject (getIndex());
 	obj->deleteSelf();
-	g_fullRefresh = true;
 }
 
 // =============================================================================

mercurial