diff --git a/src/persp3d.cpp b/src/persp3d.cpp
index 76cbc15880aeb4273a2bb77a0e36cfdc5aa94332..e5cade661d151f3efb1c12e6417fdc221ca529ab 100644 (file)
--- a/src/persp3d.cpp
+++ b/src/persp3d.cpp
@@ -212,7 +212,7 @@ persp3d_create_xml_element (SPDocument *document, Persp3D *dup) {// if dup is gi
Proj::Pt2 proj_vp_x = Proj::Pt2 (0.0, sp_document_height(document)/2, 1.0);
Proj::Pt2 proj_vp_y = Proj::Pt2 ( 0.0,1000.0, 0.0);
Proj::Pt2 proj_vp_z = Proj::Pt2 (sp_document_width(document), sp_document_height(document)/2, 1.0);
- Proj::Pt2 proj_origin = Proj::Pt2 (sp_document_width(document)/2, sp_document_height(document)/2, 1.0);
+ Proj::Pt2 proj_origin = Proj::Pt2 (sp_document_width(document)/2, sp_document_height(document)/3, 1.0);
gchar *str = NULL;
str = proj_vp_x.coord_string();
@@ -237,6 +237,19 @@ persp3d_create_xml_element (SPDocument *document, Persp3D *dup) {// if dup is gi
return (Persp3D *) sp_object_get_child_by_repr (SP_OBJECT(defs), repr);
}
+Persp3D *
+persp3d_document_first_persp (SPDocument *document) {
+ SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
+ Inkscape::XML::Node *repr;
+ for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ repr = SP_OBJECT_REPR(child);
+ if (SP_IS_PERSP3D(child)) {
+ return SP_PERSP3D(child);
+ }
+ }
+ return NULL;
+}
+
/**
* Virtual write: write object attributes to repr.
*/