summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-03-09 14:49:33 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-03-09 14:49:33 +0000
commita5260f225beb034d155643376a6985ddb35817f9 (patch)
tree0c7157445252255d628e66c0c01fc7077d360da0 /src
parentskeletal-stroke: offset parameters are back again... optionaly proportional t... (diff)
downloadinkscape-a5260f225beb034d155643376a6985ddb35817f9.tar.gz
inkscape-a5260f225beb034d155643376a6985ddb35817f9.zip
Move 3D box code out of sp-canvas.cpp
(bzr r5008)
Diffstat (limited to 'src')
-rw-r--r--src/box3d-context.cpp8
-rw-r--r--src/box3d-context.h2
-rw-r--r--src/desktop.cpp7
-rw-r--r--src/display/sp-canvas.cpp10
-rw-r--r--src/widgets/desktop-widget.cpp4
5 files changed, 21 insertions, 10 deletions
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index e03f7d184..9ee920c1b 100644
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
@@ -670,6 +670,14 @@ static void sp_box3d_finish(Box3DContext *bc)
bc->extruded = false;
}
+void sp_box3d_context_update_lines(SPEventContext *ec) {
+ /* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
+ if (SP_IS_BOX3D_CONTEXT (ec)) {
+ Box3DContext *bc = SP_BOX3D_CONTEXT (ec);
+ bc->_vpdrag->updateLines();
+ }
+}
+
/*
Local Variables:
mode:c++
diff --git a/src/box3d-context.h b/src/box3d-context.h
index 1817aa180..38058b1cb 100644
--- a/src/box3d-context.h
+++ b/src/box3d-context.h
@@ -69,6 +69,8 @@ struct Box3DContextClass {
GtkType sp_box3d_context_get_type (void);
+void sp_box3d_context_update_lines(SPEventContext *ec);
+
#endif /* __SP_BOX3D_CONTEXT_H__ */
/*
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 3ff4bf2f5..f9d17b01a 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -88,6 +88,7 @@
#include "event-log.h"
#include "display/canvas-grid.h"
#include "widgets/desktop-widget.h"
+#include "box3d-context.h"
#include "display/sp-canvas.h"
@@ -741,6 +742,9 @@ SPDesktop::set_display_area (double x0, double y0, double x1, double y1, double
/* Scroll */
sp_canvas_scroll_to (canvas, x0 * newscale - border, y1 * -newscale - border, clear);
+ /* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
+ sp_box3d_context_update_lines(event_context);
+
_widget->updateRulers();
_widget->updateScrollbars(expansion(_d2w));
_widget->updateZoom();
@@ -979,6 +983,9 @@ SPDesktop::scroll_world (double dx, double dy, bool is_scrolling)
sp_canvas_scroll_to(canvas, viewbox.min()[NR::X] - dx, viewbox.min()[NR::Y] - dy, FALSE, is_scrolling);
+ /* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
+ sp_box3d_context_update_lines(event_context);
+
_widget->updateRulers();
_widget->updateScrollbars(expansion(_d2w));
}
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index b042f0d68..86b1e9eab 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -34,7 +34,6 @@
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-convex-hull.h>
#include "prefs-utils.h"
-#include "box3d-context.h"
#include "inkscape.h"
#include "sodipodi-ctrlrect.h"
#if ENABLE_LCMS
@@ -2117,15 +2116,6 @@ sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear,
} else {
// scrolling as part of zoom; do nothing here - the next do_update will perform full redraw
}
-
- /* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
- SPEventContext *ec = inkscape_active_event_context();
- if (SP_IS_BOX3D_CONTEXT (ec)) {
- // We could avoid redraw during panning by checking the status of is_scrolling, but this is
- // neither faster nor does it get rid of artefacts, so we update PLs unconditionally
- Box3DContext *bc = SP_BOX3D_CONTEXT (ec);
- bc->_vpdrag->updateLines();
- }
}
/**
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index bd329e336..b8e01eb6c 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -59,6 +59,7 @@
#include "ege-color-prof-tracker.h"
#include "color-profile-fns.h"
#include "xml/node-observer.h"
+#include "box3d-context.h"
#if defined (SOLARIS_2_8)
#include "round.h"
@@ -1425,6 +1426,9 @@ sp_desktop_widget_adjustment_value_changed (GtkAdjustment */*adj*/, SPDesktopWid
sp_canvas_scroll_to (dtw->canvas, dtw->hadj->value, dtw->vadj->value, FALSE);
sp_desktop_widget_update_rulers (dtw);
+ /* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
+ sp_box3d_context_update_lines(dtw->desktop->event_context);
+
dtw->update = 0;
}