sp-guide.cpp revision 991a53ec8025f88323d5c1d6b64c1daabdf71da4
0N/A#ifdef HAVE_CONFIG_H
#include <algorithm>
#include <cstring>
#include <string>
#include "display/sp-canvas.h"
#include "display/guideline.h"
#include "svg/stringstream.h"
#include "attributes.h"
#include "sp-guide.h"
#include <sp-item-notify-moveto.h>
#include <sp-item.h>
#include <sp-guide-constraint.h>
#include <remove-last.h>
#include "inkscape.h"
#include "desktop.h"
#include "sp-root.h"
#include "sp-namedview.h"
#include "document.h"
#include "document-undo.h"
#include "verbs.h"
#include "sp-factory.h"
return new SPGuide();
: SPObject()
color = c;
while (this->views) {
if (this->document) {
switch (key) {
case SP_ATTR_INKSCAPE_LABEL:
if (value) {
case SP_ATTR_ORIENTATION:
} else if (value) {
case SP_ATTR_POSITION:
if (value) {
if(Geom::are_near((root->viewBox.width() * root->height.computed) / (root->width.computed * root->viewBox.height()), 1.0, Geom::EPSILON)) {
double px2vbunit = (root->viewBox.width()/root->width.computed + root->viewBox.height()/root->height.computed)/2.0;
if (namedview) {
return guide;
void sp_guide_pt_pairs_to_guides(SPDocument *doc, std::list<std::pair<Geom::Point, Geom::Point> > &pts)
for (std::list<std::pair<Geom::Point, Geom::Point> >::iterator i = pts.begin(); i != pts.end(); ++i) {
assert(false);
assert(false);
if (commit) {
if(Geom::are_near((root->viewBox.width() * root->height.computed) / (root->width.computed * root->viewBox.height()), 1.0, Geom::EPSILON)) {
double px2vbunit = (root->viewBox.width()/root->width.computed + root->viewBox.height()/root->height.computed)/2.0;
sp_item_notify_moveto(*att.item, this, att.snappoint_ix, position, commit);
if (commit) {
sp_item_notify_moveto(*att.item, this, att.snappoint_ix, position, commit);
if (views) {
if (commit) {
if (views) {
if (commit) {
using Geom::X;
using Geom::Y;
if ( !this->document ) {
gchar *shortcuts = g_strdup_printf("; %s", _("<b>Shift+drag</b> to rotate, <b>Ctrl+drag</b> to move origin, <b>Del</b> to delete"));
if (verbose) {
return descr;
i != iEnd; ++i)