Lines Matching refs:dragger

77 // absolute distance between gradient points for them to become a single dragger when the drag is created:
134 * skip), and fill the \a style with the averaged color of all draggables of the selected dragger, if
156 for(std::vector<GrDraggable *>::const_iterator it2 = d->draggables.begin(); it2 != d->draggables.end(); ++it2 ) { //for all draggables of dragger
311 for(std::vector<GrDraggable *>::const_iterator it2 = d->draggables.begin(); it2 != d->draggables.end(); ++it2 ) { //for all draggables of dragger
334 for(std::vector<GrDraggable *>::const_iterator it2 = d->draggables.begin(); it2 != d->draggables.end(); ++it2 ) { //for all draggables of dragger
588 for(std::vector<GrDraggable *>::const_iterator j = d->draggables.begin(); j != d->draggables.end(); ++j) { //for all draggables of dragger
662 GrDragger *dragger = getDraggerFor(desktop->gr_item, desktop->gr_point_type, desktop->gr_point_i, desktop->gr_fill_or_stroke);
663 if (dragger) {
664 setSelected(dragger);
738 GrDragger *dragger = (GrDragger *) data;
739 GrDrag *drag = dragger->parent;
743 SPDesktop *desktop = dragger->parent->desktop;
745 double snap_dist = m.snapprefs.getObjectTolerance() / dragger->parent->desktop->current_zoom();
749 if (dragger->draggables.size()>1) {
750 // create a new dragger
751 GrDragger *dr_new = new GrDragger (dragger->parent, dragger->point, NULL);
752 dragger->parent->draggers.insert(dragger->parent->draggers.begin(), dr_new);
754 std::vector<GrDraggable *>::const_iterator i = dragger->draggables.begin();
755 for ( ++i ; i != dragger->draggables.end(); ++i ) {
760 if(dragger->draggables.size()>1){
761 GrDraggable *tmp = dragger->draggables[0];
762 dragger->draggables.clear();
763 dragger->draggables.push_back(tmp);
765 dragger->updateKnotShape();
766 dragger->updateTip();
769 // without Shift or Ctrl; see if we need to snap to another dragger
770 for (std::vector<GrDragger *>::const_iterator di = dragger->parent->draggers.begin(); di != dragger->parent->draggers.end() ; ++di) {
772 if (dragger->mayMerge(d_new) && Geom::L2 (d_new->point - p) < snap_dist) {
775 for (std::vector<GrDraggable *>::const_iterator i = dragger->draggables.begin(); i != dragger->draggables.end(); ++i) {
782 // unlink and delete this dragger
783 dragger->parent->draggers.erase(std::remove(dragger->parent->draggers.begin(),dragger->parent->draggers.end(), dragger),dragger->parent->draggers.end());
784 d_new->parent->draggers.erase(std::remove(d_new->parent->draggers.begin(),d_new->parent->draggers.end(), dragger),d_new->parent->draggers.end());
785 d_new->parent->selected.erase(dragger);
786 delete dragger;
791 // update the new merged dragger
819 for (std::vector<GrDraggable *>::const_iterator i = dragger->draggables.begin(); i != dragger->draggables.end(); ++i) {
825 for (std::vector<GrDragger *>::const_iterator di = dragger->parent->draggers.begin() ; di != dragger->parent->draggers.end() ; ++di) {
827 if (d_new == dragger)
835 Geom::Point center = Geom::Point (0.5*(d_new->point + dragger->point));
844 for (std::vector<GrDragger *>::const_iterator di = dragger->parent->draggers.begin(); di != dragger->parent->draggers.end(); ++di) {
846 if (d_new == dragger)
857 dr_snap = dragger->point_original;
870 sp = m.constrainedAngularSnap(scp, dragger->point_original, dr_snap, 2);
898 drag->keep_selection = (drag->selected.find(dragger)!=drag->selected.end());
902 Geom::Point diff = p - dragger->point;
905 Geom::Point p_old = dragger->point;
906 dragger->point = p;
907 dragger->fireDraggables (false, scale_radial);
908 dragger->updateDependencies(false);
909 dragger->updateHandles( p_old, MG_NODE_NO_SCALE );
914 static void gr_midpoint_limits(GrDragger *dragger, SPObject *server, Geom::Point *begin, Geom::Point *end, Geom::Point *low_lim, Geom::Point *high_lim, std::vector<GrDragger *> &moving)
917 GrDrag *drag = dragger->parent;
918 // a midpoint dragger can (logically) only contain one GrDraggable
919 GrDraggable *draggable = dragger->draggables[0];
923 moving.push_back(dragger);
927 GrDragger *lowest_dragger = dragger;
928 GrDragger *highest_dragger = dragger;
929 if (dragger->isSelected()) {
992 *low_lim = dragger->point - (lowest_dragger->point - *begin);
993 *high_lim = dragger->point - (highest_dragger->point - *end);
1001 GrDragger *dragger = (GrDragger *) data;
1002 GrDrag *drag = dragger->parent;
1003 // a midpoint dragger can (logically) only contain one GrDraggable
1004 GrDraggable *draggable = dragger->draggables[0];
1016 gr_midpoint_limits(dragger, server, &begin, &end, &low_lim, &high_lim, moving);
1026 SPDesktop *desktop = dragger->parent->desktop;
1033 Geom::Point displacement = p - dragger->point;
1042 if (Geom::L2(drg->point - dragger->point) + Geom::L2(drg->point - begin) - 1e-3 > Geom::L2(dragger->point - begin)) { // drg is on the end side from dragger
1043 double x = Geom::L2(drg->point - dragger->point)/Geom::L2(end - dragger->point);
1045 } else { // drg is on the begin side from dragger
1046 double x = Geom::L2(drg->point - dragger->point)/Geom::L2(begin - dragger->point);
1056 drag->keep_selection = dragger->isSelected();
1063 GrDragger *dragger = (GrDragger *) data;
1065 dragger->parent->desktop->canvas->forceFullRedrawAfterInterruptions(5);
1069 * Called when the mouse releases a dragger knot; changes gradient writing to repr, updates other draggers if needed.
1073 GrDragger *dragger = (GrDragger *) data;
1075 dragger->parent->desktop->canvas->endForcedFullRedraws();
1077 dragger->point_original = dragger->point = knot->pos;
1080 dragger->fireDraggables (true, true);
1082 dragger->fireDraggables (true);
1084 dragger->updateHandles( dragger->point_original, MG_NODE_NO_SCALE );
1086 for (std::set<GrDragger *>::const_iterator it = dragger->parent->selected.begin(); it != dragger->parent->selected.end() ; ++it ) {
1087 if (*it == dragger)
1092 // make this dragger selected
1093 if (!dragger->parent->keep_selection) {
1094 dragger->parent->setSelected (dragger);
1096 dragger->parent->keep_selection = false;
1098 dragger->updateDependencies(true);
1101 DocumentUndo::done(dragger->parent->desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT, _("Move gradient handle"));
1105 * Called when a dragger knot is clicked; selects the dragger or deletes it depending on the
1110 GrDragger *dragger = (GrDragger *) data;
1111 GrDraggable *draggable = dragger->draggables[0];
1163 // select the dragger
1165 dragger->point_original = dragger->point;
1168 dragger->parent->setSelected (dragger, true, false);
1170 dragger->parent->setSelected (dragger);
1176 * Called when a dragger knot is doubleclicked;
1180 GrDragger *dragger = (GrDragger *) data;
1182 dragger->point_original = dragger->point;
1184 if (dragger->draggables.empty())
1190 //GrDraggable *draggable = (GrDraggable *) dragger->draggables->data;
1195 * Act upon all draggables of the dragger, setting them to the dragger's point.
1216 * Checks if the dragger has a draggable with this point_type.
1230 * Checks if the dragger has a draggable with this item, point_type + point_i (number), fill_or_stroke.
1244 * Checks if the dragger has a draggable with this item, point_type, fill_or_stroke.
1326 // sharing the same dragger (overkill, perhaps?).
1339 GrDragger *dragger = *it;
1340 for (std::vector<GrDraggable *>::const_iterator it2 = dragger->draggables.begin(); it2 != dragger->draggables.end(); ++it2 ) {
1407 * Updates the statusbar tip of the dragger knot, based on its draggables.
1450 * Adds a draggable to the dragger.
1461 * Adds a draggable to the dragger.
1472 * Moves this dragger to the point of the given draggable, acting upon all other draggables.
1655 * Select the dragger which has the given draggable.
1660 GrDragger *dragger = *i;
1661 for (std::vector<GrDraggable *>::const_iterator j = dragger->draggables.begin(); j != dragger->draggables.end(); ++j ) {
1667 return (dragger);
1685 * Draw this dragger as selected.
1701 * Draw this dragger as normal (deselected).
1768 GrDragger *dragger = *l;
1769 for (std::vector<GrDraggable *>::const_iterator j = dragger->draggables.begin(); j != dragger->draggables.end(); ++j) {
1777 setSelected(dragger, add_to_selection, override);
1796 * Select a dragger.
1797 * @param dragger The dragger to select.
1801 void GrDrag::setSelected(GrDragger *dragger, bool add_to_selection, bool override)
1806 // We might want to rethink since a dragger can have draggables of different types.
1807 if ( dragger->isA( POINT_MG_HANDLE ) || dragger->isA( POINT_MG_TENSOR ) ) return;
1810 if (!dragger) return;
1812 selected.insert(dragger);
1813 dragger->select();
1814 seldragger = dragger;
1816 if(selected.find(dragger)!=selected.end()) {
1817 selected.erase(dragger);
1818 dragger->deselect();
1820 seldragger = *(selected.begin()); // select the dragger that is first in the list
1823 selected.insert(dragger);
1824 dragger->select();
1825 seldragger = dragger;
1830 if (dragger) {
1831 selected.insert(dragger);
1832 dragger->select();
1833 seldragger = dragger;
1842 * Deselect a dragger.
1843 * @param dragger The dragger to deselect.
1845 void GrDrag::setDeselected(GrDragger *dragger)
1847 if (selected.find(dragger) != selected.end()) {
1848 selected.erase(dragger);
1849 dragger->deselect();
1888 * If there already exists a dragger within MERGE_DIST of p, add the draggable to it; otherwise create
1889 * new dragger and add it to draggers list.
1896 GrDragger *dragger = *l;
1897 if (dragger->mayMerge (draggable) && Geom::L2 (dragger->point - p) < MERGE_DIST) {
1898 // distance is small, merge this draggable into dragger, no need to create new dragger
1899 dragger->addDraggable (draggable);
1900 dragger->updateKnotShape();
2037 * Artificially grab the knot of this dragger; used by the gradient context.
2040 void GrDrag::grabKnot(GrDragger *dragger, gint x, gint y, guint32 etime)
2042 if (dragger) {
2043 dragger->knot->startDragging(dragger->point, x, y, etime);
2048 * Artificially grab the knot of the dragger with this draggable; used by the gradient context.
2053 GrDragger *dragger = getDraggerFor(item, point_type, point_i, fill_or_stroke);
2054 if (dragger) {
2055 dragger->knot->startDragging(dragger->point, x, y, etime);
2061 * modified, also when a radial dragger needs to update positions of other draggers in the gradient.
2128 * Regenerates the lines list from the current selection; is called on each move of a dragger, so that
2370 GrDragger *dragger = *(selected.begin());
2371 // a midpoint dragger can (logically) only contain one GrDraggable
2372 GrDraggable *draggable = dragger->draggables[0];
2379 gr_midpoint_limits(dragger, server, &begin, &end, &low_lim, &high_lim, moving);
2382 Geom::Point p = ls.pointAt(ls.nearestTime(dragger->point + Geom::Point(x,y)));
2383 Geom::Point displacement = p - dragger->point;
2464 GrDragger *dragger = *(selected.begin());
2465 for(std::vector<GrDraggable *>::const_iterator drgble = dragger->draggables.begin(); drgble != dragger->draggables.end(); ++drgble) {
2524 selected.erase(dragger);