Lines Matching refs:guide
47 #include "sp-guide.h"
61 void sp_dt_ruler_snap_new_guide(SPDesktop *desktop, SPCanvasItem *guide, Geom::Point &event_dt, Geom::Point &normal);
90 static SPCanvasItem *guide = NULL;
160 guide = sp_guideline_new(desktop->guides, NULL, event_dt, normal);
161 sp_guideline_set_color(SP_GUIDELINE(guide), desktop->namedview->guidehicolor);
193 // explicitly show guidelines; if I draw a guide, I want them on
199 sp_dt_ruler_snap_new_guide(desktop, guide, event_dt, normal);
201 sp_guideline_set_normal(SP_GUIDELINE(guide), normal);
202 sp_guideline_set_position(SP_GUIDELINE(guide), event_dt);
221 sp_dt_ruler_snap_new_guide(desktop, guide, event_dt, normal);
224 sp_canvas_item_destroy(guide);
225 guide = NULL;
228 Inkscape::XML::Node *repr = xml_doc->createElement("sodipodi:guide");
244 _("Create guide"));
249 // Ruler click (without drag) toggle the guide visibility on and off
294 SPGuide *guide = SP_GUIDE(data);
303 Inkscape::UI::Dialogs::GuidelinePropertiesDialog::showDialog(guide, desktop);
312 // Due to the tolerance allowed when grabbing a guide, event_dt will generally
313 // be close to the guide but not just exactly on it. The drag origin calculated
314 // here must be exactly on the guide line though, otherwise
317 drag_origin = Geom::projection(event_dt, Geom::Line(guide->getPoint(), guide->angle()));
320 // with shift we rotate the guide
352 m.setup(desktop, true, NULL, NULL, guide);
355 // be forced to be on the guide. If we don't snap however, then
356 // the origin should still be constrained to the guide. So let's do
358 Geom::Line line(guide->getPoint(), guide->angle());
362 m.guideConstrainedSnap(motion_dt, *guide);
365 // cannot use shift here to disable snapping, because we already use it for rotating the guide
368 temp = guide->getPoint();
370 guide->moveto(temp, false);
372 temp = guide->getNormal();
374 guide->set_normal(temp, false);
382 guide->moveto(motion_dt, false);
387 Geom::Point pt = motion_dt - guide->getPoint();
395 Geom::Angle orig_angle(guide->getNormal());
405 guide->set_normal(Geom::Point::polar(angle).cw(), false);
410 guide->moveto(motion_dt, false);
433 m.setup(desktop, true, NULL, NULL, guide);
436 // be forced to be on the guide. If we don't snap however, then
437 // the origin should still be constrained to the guide. So let's
439 Geom::Line line(guide->getPoint(), guide->angle());
443 m.guideConstrainedSnap(event_dt, *guide);
446 // cannot use shift here to disable snapping, because we already use it for rotating the guide
449 temp = guide->getPoint();
451 guide->moveto(temp, false);
453 temp = guide->getNormal();
455 guide->set_normal(temp, false);
464 guide->moveto(event_dt, true);
469 Geom::Point pt = event_dt - guide->getPoint();
477 Geom::Angle orig_angle(guide->getNormal());
487 guide->set_normal(Geom::Point::polar(angle).cw(), true);
492 guide->moveto(event_dt, true);
500 _("Move guide"));
503 guide->moveto(guide->getPoint(), false);
504 guide->set_normal(guide->getNormal(), false);
505 sp_guide_remove(guide);
507 _("Delete guide"));
519 if (!guide->getLocked()) {
520 sp_guideline_set_color(SP_GUIDELINE(item), guide->getHiColor());
536 if(guide->getLocked()){
546 char *guide_description = guide->description();
552 sp_guideline_set_color(SP_GUIDELINE(item), guide->getColor());
565 SPDocument *doc = guide->document;
566 sp_guide_remove(guide);
567 DocumentUndo::done(doc, SP_VERB_NONE, _("Delete guide"));
745 void sp_dt_ruler_snap_new_guide(SPDesktop *desktop, SPCanvasItem * /*guide*/, Geom::Point &event_dt, Geom::Point &normal)
749 // We're dragging a brand new guide, just pulled of the rulers seconds ago. When snapping to a
750 // path this guide will change it slope to become either tangential or perpendicular to that path. It's
756 // We only have a temporary guide which is not stored in our document yet.
757 // Because the guide snapper only looks in the document for guides to snap to,
758 // we don't have to worry about a guide snapping to itself here
762 // curve we snapped to) to set the normal the guide. And rotate it by 90 deg. if needed