summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb4890b)
raw | patch | inline | side by side (parent: eb4890b)
author | johncoswell <johncoswell@users.sourceforge.net> | |
Sun, 23 Jul 2006 03:32:23 +0000 (03:32 +0000) | ||
committer | johncoswell <johncoswell@users.sourceforge.net> | |
Sun, 23 Jul 2006 03:32:23 +0000 (03:32 +0000) |
diff --git a/ChangeLog b/ChangeLog
index a3a4a352d12e79391d46ed06128a4be721ce4919..2a200a61d32f04d87ce50880c14646b91fc16860 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-07-22 John Bintz <jcoswell@coswellproductions.org>
+
+ * src/desktop.cpp, src/desktop.h, src/document-undo.cpp,
+ src/document.h, src/document-private.h, src/document.cpp:
+
+ forced redraw of canvas upon document commit to work
+ around event starvation issue at high zoom levels
+
2006-07-21 MenTaLguY <mental@rydia.net>
* src/splivarot.cpp:
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 49a43bc37b53e98bdfbb7064fe0c7d53cd649aaa..cbd5ffa6021cdd8926137218edba9d740548636f 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
_reconstruction_finish_connection =
document->connectReconstructionFinish(sigc::bind(sigc::ptr_fun(_reconstruction_finish), this));
_reconstruction_old_layer_id = NULL;
-
+
+ _commit_connection = document->connectCommit(sigc::bind(sigc::ptr_fun(&sp_canvas_update_now), this->canvas));
+
// ?
// sp_active_desktop_set (desktop);
_inkscape = INKSCAPE;
/**
* Associate document with desktop.
*/
+/// \todo fixme: refactor SPDesktop::init to use setDocument
void
SPDesktop::setDocument (SPDocument *doc)
{
_layer_hierarchy->connectChanged(sigc::bind(sigc::ptr_fun(_layer_hierarchy_changed), this));
_layer_hierarchy->setTop(SP_DOCUMENT_ROOT(doc));
+ _commit_connection.disconnect();
+ _commit_connection = doc->connectCommit(sigc::bind(sigc::ptr_fun(&sp_canvas_update_now), this->canvas));
+
/// \todo fixme: This condition exists to make sure the code
/// inside is called only once on initialization. But there
/// are surely more safe methods to accomplish this.
diff --git a/src/desktop.h b/src/desktop.h
index 0a2d932f8628c709d17eef930efeb2cb80b2e18b..dde2962a7e812ea157ea99d6aa804dd926a233f9 100644 (file)
--- a/src/desktop.h
+++ b/src/desktop.h
sigc::connection _sel_changed_connection;
sigc::connection _reconstruction_start_connection;
sigc::connection _reconstruction_finish_connection;
+ sigc::connection _commit_connection;
virtual void onPositionSet (double, double);
virtual void onResized (double, double);
diff --git a/src/document-private.h b/src/document-private.h
index 18d35f446a7f3d7ac5592d0ffb1b1d2521ec9633..cb83c9376eb268feca56338333a7be8e9076c489 100644 (file)
--- a/src/document-private.h
+++ b/src/document-private.h
SPDocument::ResizedSignal resized_signal;
SPDocument::ReconstructionStart _reconstruction_start_signal;
SPDocument::ReconstructionFinish _reconstruction_finish_signal;
+ SPDocument::CommitSignal commit_signal;
/* Undo/Redo state */
guint sensitive: 1; /* If we save actions to undo stack */
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 35b35c88830baa97421d6a3cc66e445328dda681..09bb4e85729da13d2927cbdc5ce37bde63e5841c 100644 (file)
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -162,6 +162,8 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
}
sp_repr_begin_transaction (doc->rdoc);
+
+ doc->priv->commit_signal.emit();
}
void
diff --git a/src/document.cpp b/src/document.cpp
index 3077198cf149a0b327efb470d0998ab1f17c2c7f..20bbeb73e10d9ea9f5eb82f2ccac2e236933499d 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
return;
}
+sigc::connection SPDocument::connectCommit(SPDocument::CommitSignal::slot_type slot)
+{
+ return priv->commit_signal.connect(slot);
+}
+
+
void SPDocument::_emitModified() {
static guint const flags = SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG | SP_OBJECT_PARENT_MODIFIED_FLAG;
diff --git a/src/document.h b/src/document.h
index cf2194a952a64ba67a6ba55ad4f8f9bf218a741d..b0afba5ec50e05e7b914eb0cf64ad5845f8a33ae 100644 (file)
--- a/src/document.h
+++ b/src/document.h
typedef sigc::signal<void, double, double> ResizedSignal;
typedef sigc::signal<void> ReconstructionStart;
typedef sigc::signal<void> ReconstructionFinish;
+ typedef sigc::signal<void> CommitSignal;
SPDocument();
~SPDocument();
sigc::connection connectModified(ModifiedSignal::slot_type slot);
sigc::connection connectURISet(URISetSignal::slot_type slot);
sigc::connection connectResized(ResizedSignal::slot_type slot);
+ sigc::connection connectCommit(CommitSignal::slot_type slot);
void bindObjectToId(gchar const *id, SPObject *object);
SPObject *getObjectById(gchar const *id);