bool CurveDragPoint::clicked(GdkEventButton *event) { // This check is probably redundant if (!first || event->button != 1) return false; // the next iterator can be invalid if we click very near the end of path NodeList::iterator second = first.next(); if (!second) return false; // insert nodes on Ctrl+Alt+click if (held_control(*event) && held_alt(*event)) { _insertNode(false); return true; } if (held_shift(*event)) { // if both nodes of the segment are selected, deselect; // otherwise add to selection if (first->selected() && second->selected()) { _pm._selection.erase(first.ptr()); _pm._selection.erase(second.ptr()); } else { _pm._selection.insert(first.ptr()); _pm._selection.insert(second.ptr()); } } else { // without Shift, take selection _pm._selection.clear(); _pm._selection.insert(first.ptr()); _pm._selection.insert(second.ptr()); } return true; }
U32 DecalRoad::insertNode(const Point3F &pos, const F32 &width, const U32 &idx) { U32 ret = _insertNode( pos, width, idx ); _generateEdges(); scheduleUpdate( GenEdgesMask | ReClipMask | NodeMask ); return ret; }
int List_iteratorInsert(LinkedList* list, void* data) { if(list == NULL || data == NULL) { return(LIST_ERR_NULL_ARG); } if(list->_curNode == list->_firstNode) { return(List_prepend(list, data)); } _insertNode(list->_curNode->prev, list->_curNode, data); return(LIST_FUNC_SUCCESS); }
int List_prepend(LinkedList* list, void* data) { if (list == NULL || data == NULL) { return(LIST_ERR_NULL_ARG); } list->_firstNode = _insertNode(NULL, list->_firstNode, data); // If list was empty we need to initialize all member variables. if(list->_lastNode == NULL) { list->_lastNode = list->_curNode = list->_firstNode; } return(LIST_FUNC_SUCCESS); }
bool CurveDragPoint::doubleclicked(GdkEventButton *event) { if (event->button != 1 || !first || !first.next()) return false; _insertNode(true); return true; }