diff options
| -rw-r--r-- | src/ui/tool/curve-drag-point.cpp | 5 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 5 | ||||
| -rw-r--r-- | src/ui/tool/node.cpp | 64 | ||||
| -rw-r--r-- | src/ui/tool/node.h | 2 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 14 | ||||
| -rw-r--r-- | src/ui/tools/freehand-base.cpp | 23 | ||||
| -rw-r--r-- | src/ui/tools/node-tool.h | 3 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 67 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.h | 26 | ||||
| -rw-r--r-- | src/ui/tools/pencil-tool.cpp | 4 |
10 files changed, 107 insertions, 106 deletions
diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp index ad03cf75d..e5412fdc2 100644 --- a/src/ui/tool/curve-drag-point.cpp +++ b/src/ui/tool/curve-drag-point.cpp @@ -53,7 +53,7 @@ bool CurveDragPoint::grabbed(GdkEventMotion */*event*/) // delta is a vector equal 1/3 of distance from first to second Geom::Point delta = (second->position() - first->position()) / 3.0; - // only update the nodes if the mode is bspline + //spanish: solo actualizamos los nodos si no es bspline if(!_pm.isBSpline(false)){ first->front()->move(first->front()->position() + delta); second->back()->move(second->back()->position() - delta); @@ -89,8 +89,7 @@ void CurveDragPoint::dragged(Geom::Point &new_pos, GdkEventMotion *event) Geom::Point delta = new_pos - position(); Geom::Point offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; Geom::Point offset1 = (weight/(3*t*t*(1-t))) * delta; - - //modified so that, if the trace is bspline, it only acts if the SHIFT key is pressed + //spanish: modificado para que, si el trazado es bspline solo actue si está presionada la tecla SHIFT if(!_pm.isBSpline(false)){ first->front()->move(first->front()->position() + offset0); second->back()->move(second->back()->position() + offset1); diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 68aaa77a5..b7f3ac29b 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -671,10 +671,9 @@ bool MultiPathManipulator::event(Inkscape::UI::Tools::ToolBase *event_context, G // b) ctrl+del preserves shape (del_preserves_shape is false), and control is pressed // Hence xor guint mode = prefs->getInt("/tools/freehand/pen/freehand-mode", 0); - - //if the trace is bspline ( mode 2) + //spanish: si es trazado bspline (mode 2) if(mode==2){ - // is this correct ? + //spanish: ¿correcto? if(del_preserves_shape ^ held_control(event->key)) deleteNodes(false); else diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 73460a313..78d8fe833 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -167,7 +167,7 @@ void Handle::move(Geom::Point const &new_pos) } setPosition(new_pos); - //move the handler and its oposite the same proportion + //spanish: mueve el tirador y su opuesto la misma proporción if(_pm().isBSpline(false)){ setPosition(_pm().BSplineHandleReposition(this)); this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),_parent->bsplineWeight)); @@ -184,7 +184,7 @@ void Handle::move(Geom::Point const &new_pos) / Geom::L2sq(direction)) * direction; setRelativePos(new_delta); - //move the handler and its oposite the same proportion + //spanish: mueve el tirador y su opuesto la misma proporción if(_pm().isBSpline(false)){ setPosition(_pm().BSplineHandleReposition(this)); this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),_parent->bsplineWeight)); @@ -210,7 +210,7 @@ void Handle::move(Geom::Point const &new_pos) } setPosition(new_pos); - // moves the handler and its oposite the same proportion + //spanish: mueve el tirador y su opuesto la misma proporción if(_pm().isBSpline(false)){ setPosition(_pm().BSplineHandleReposition(this)); this->other()->setPosition(_pm().BSplineHandleReposition(this->other(),_parent->bsplineWeight)); @@ -292,7 +292,7 @@ bool Handle::_eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEven break; default: break; } - // new double click event to set the handlers of a node to the default proportion, 0.3334% + //spanish: nuevo evento de doble click para resetear a la proporción por defecto, 0.3334%, los tiradores de un nodo case GDK_2BUTTON_PRESS: handle_2button_press(); break; @@ -303,7 +303,7 @@ bool Handle::_eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEven return ControlPoint::_eventHandler(event_context, event); } -//this function moves the handler and its oposite to the default proportion of 0.3334 +//spanish: función que mueve el tirador y su opuesto a la proporción por defecto de 0.3334 void Handle::handle_2button_press(){ if(_pm().isBSpline(false)){ setPosition(_pm().BSplineHandleReposition(this,0.3334)); @@ -359,8 +359,8 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) ctrl_constraint = Inkscape::Snapper::SnapConstraint(parent_pos, parent_pos - perp_pos); } new_pos = result; - // moves the handler and its oposite in X fixed positions depending on parameter "steps with control" - // by default in live BSpline + //spanish: mueve el tirador y su opuesto en X posiciones fijas depenfiendo de la configuración de el + //parametro "steps whith control" del efecto en vivo BSpline if(_pm().isBSpline(false)){ setPosition(new_pos); int steps = _pm().BSplineGetSteps(); @@ -370,7 +370,7 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) } std::vector<Inkscape::SnapCandidatePoint> unselected; - //if the snap adjustment is activated and it is not bspline + //spanish: si está activado el ajuste (snap) y no es bspline if (snap && !_pm().isBSpline(false)) { ControlPointSelection::Set &nodes = _parent->_selection.allPoints(); for (ControlPointSelection::Set::iterator i = nodes.begin(); i != nodes.end(); ++i) { @@ -411,7 +411,8 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) other()->setPosition(_saved_other_pos); } } - //if it is bspline but SHIFT or CONTROL are not pressed it fixes it in the original position + //spanish: si es bspline pero no está presionado SHIFT o CONTROL + //lo fija en la posición original if(_pm().isBSpline(false) && !held_shift(*event) && !held_control(*event)){ new_pos=_last_drag_origin(); } @@ -431,7 +432,7 @@ void Handle::ungrabbed(GdkEventButton *event) Geom::Point dist = _desktop->d2w(_parent->position()) - _desktop->d2w(position()); if (dist.length() <= drag_tolerance) { move(_parent->position()); - //sets the bspline strength to 0.0000 + //spanish: marca la fuerza del bspline como 0.0000 if(_pm().isBSpline(false)){ _parent->bsplineWeight = 0.0000; } @@ -477,9 +478,9 @@ static double snap_increment_degrees() { Glib::ustring Handle::_getTip(unsigned state) const { char const *more; - // a trick to mark as bspline if the node has no strength, we are going to use it later - // to show the appropiate messages. We cannot do it in any different way becasue the function is constant - + //spanish: un truco para, si el nodo tiene fuerza, nos marca que es + //del tipo bspline, lo utilizaremos despues para mostras los mensajes apropiados + //no lo podemos hacer de otra forma al ser constante la funcion bool isBSpline = false; if( _parent->bsplineWeight != 0.0000) isBSpline = true; @@ -621,8 +622,8 @@ void Node::move(Geom::Point const &new_pos) // move handles when the node moves. Geom::Point old_pos = position(); Geom::Point delta = new_pos - position(); - - // save the previous node strength to apply it again once the node is moved + //spanish: guardamos la fuerza anterior del nodo para reaplicarsela + //de nuevo una vez sea movido el nodo double oldPos = 0.0000; Node *n = this; if(_pm().isBSpline(false)){ @@ -637,8 +638,8 @@ void Node::move(Geom::Point const &new_pos) // if the node has a smooth handle after a line segment, it should be kept colinear // with the segment _fixNeighbors(old_pos, new_pos); - - // move the affected handlers. First the node ones, later the adjoining ones. + //spanish: movemos los tiradores involucrados, primero los del nodo en cuestión + //y despues los de los nodos colindantes if(_pm().isBSpline(false)){ _front.setPosition(_pm().BSplineHandleReposition(this->front(),oldPos)); _back.setPosition(_pm().BSplineHandleReposition(this->back(),oldPos)); @@ -648,7 +649,8 @@ void Node::move(Geom::Point const &new_pos) void Node::transform(Geom::Affine const &m) { - // save the previous node strength to apply it again later when the node is moved + //spanish: guardamos la fuerza anterior del nodo para reaplicarsela + //de nuevo una vez sea movido el nodo double oldPos = 0.0000; if(_pm().isBSpline(false)){ oldPos = this->bsplineWeight; @@ -661,8 +663,8 @@ void Node::transform(Geom::Affine const &m) /* Affine transforms keep handle invariants for smooth and symmetric nodes, * but smooth nodes at ends of linear segments and auto nodes need special treatment */ _fixNeighbors(old_pos, position()); - - // move the involved handlers, first the node ones, later the adjoining ones + //spanish: movemos los tiradores involucrados, primero los del nodo en cuestión + //y despues los de los nodos colindantes if(_pm().isBSpline(false)){ _front.setPosition(_pm().BSplineHandleReposition(this->front(),oldPos)); _back.setPosition(_pm().BSplineHandleReposition(this->back(),oldPos)); @@ -753,11 +755,9 @@ void Node::showHandles(bool v) if (!_back.isDegenerate()) { _back.setVisible(v); } - - // define the node strength, depending on being or not bspline traced. - // every time we operate over these handlers in a trace bspline - // that strength needs to be updated. - + //spanish: definimos la fuerza de los nodos,según sea o no trazado bspline. + //Cada vez que actuemos sobre dichos tiradores en un trazado + //bspline esta fuerza se tiene que actualizar this->bsplineWeight = 0.0000; if(_pm().isBSpline(false) && (!_front.isDegenerate() || !_back.isDegenerate())){ if (!_front.isDegenerate()) { @@ -868,8 +868,9 @@ void Node::setType(NodeType type, bool update_handles) break; default: break; } - /* in node type changes, about bspline traces, we can mantain them with 0.0000 power in border mode, - or we give them the default power in curve mode */ + //spanish: en los cambios de tipo de nodo, sobre trazados bspline, + //o bien los mantenemos con potencia 0.0000 en modo esquina + //o les damos la potencia por defecto en modo de curva if(_pm().isBSpline(false)){ if(this->bsplineWeight !=0.0000) this->bsplineWeight = 0.3334; _front.setPosition(_pm().BSplineHandleReposition(this->front(),this->bsplineWeight)); @@ -1122,7 +1123,7 @@ void Node::_setState(State state) case STATE_CLICKED: mgr.setActive(_canvas_item, true); mgr.setPrelight(_canvas_item, false); - //this shows the handlers when selecting the nodes + //spanish: esto muestra los tiradores al seleccionar los nodos if(_pm().isBSpline(false)){ if(!this->back()->isDegenerate()){ _pm().BSplineHandlePosition(this->back()); @@ -1388,10 +1389,9 @@ Node *Node::nodeAwayFrom(Handle *h) Glib::ustring Node::_getTip(unsigned state) const { - - /* if the node doesnt have strength, it marks it as bspline, we'll use it later - to show the appropiate messages. We cannot do it in any other way, because the - function is constant */ + //spanish: un truco par, si el nodo tiene fuerza, nos marca que es + //del tipo bspline, lo utilizaremos despues para mostras los mensajes apropiados + //no lo podemos hacer de otra forma al ser constante la funcion bool isBSpline = false; if( this->bsplineWeight != 0.0000) isBSpline = true; diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h index 4393446d9..b7d6951d0 100644 --- a/src/ui/tool/node.h +++ b/src/ui/tool/node.h @@ -187,7 +187,7 @@ public: bool isEndNode() const; Handle *front() { return &_front; } Handle *back() { return &_back; } - //strength value for each node + //spanish: creamos valor de potencia bspline asociado a cada nodo double bsplineWeight; /** diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 1cc075603..a6689d93d 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -663,7 +663,7 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite nl.erase(start); start = next; } - // if we are removing, we readjust the handlers + //spanish: si se borra, reajustamos los tiradores if(isBSpline(false)){ double pos = 0.0000; if(start.prev()){ @@ -1182,7 +1182,7 @@ void PathManipulator::_createControlPointsFromGeometry() } } -//determines if the trace has a bspline effect and the number of steps that it takes +//spanish: determina si el trazado tiene efecto bspline y el numero de pasos que realiza int PathManipulator::BSplineGetSteps(){ LivePathEffect::LPEBSpline *lpe_bsp = NULL; @@ -1200,7 +1200,7 @@ int PathManipulator::BSplineGetSteps(){ return steps; } -// determines if the trace has bspline effect +//spanish: determina si el trazado tiene efecto bspline bool PathManipulator::isBSpline(bool recalculate){ static int BSplineSteps = this->BSplineGetSteps(); if(recalculate){ @@ -1213,7 +1213,7 @@ bool PathManipulator::isBSpline(bool recalculate){ return isBSpline; } -// returns the corresponding strength to the position of a handler +//spanish: devuelve la fuerza que le corresponderia a la posicón de un tirador double PathManipulator::BSplineHandlePosition(Handle *h){ using Geom::X; using Geom::Y; @@ -1231,13 +1231,13 @@ double PathManipulator::BSplineHandlePosition(Handle *h){ return pos; } -// moves the handler to the corresponding position +//spanish: mueve el tirador a la posición que le corresponda Geom::Point PathManipulator::BSplineHandleReposition(Handle *h){ double pos = this->BSplineHandlePosition(h); return BSplineHandleReposition(h,pos); } -// moves the handler to the specified position +//spanish: mueve el tirador a una posición específica Geom::Point PathManipulator::BSplineHandleReposition(Handle *h,double pos){ using Geom::X; using Geom::Y; @@ -1263,7 +1263,7 @@ Geom::Point PathManipulator::BSplineHandleReposition(Handle *h,double pos){ return ret; } -//moves the node handlers and its oposite handlers to the strength of its nodes +//spanish: mueve los tiradores del nodo y sus tiradores opuestos a la potencia de sus nodos void PathManipulator::BSplineNodeHandlesReposition(Node *n){ Node * nextNode = n->nodeToward(n->front()); Node * prevNode = n->nodeToward(n->back()); diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 40a257de9..cb6111bd5 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -252,7 +252,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, if (prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1) { Effect::createAndApply(SPIRO, dc->desktop->doc(), item); } - //add the bspline node in the waiting effects + //spanish: añadimos el modo bspline a los efectos en espera if (prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2) { Effect::createAndApply(BSPLINE, dc->desktop->doc(), item); } @@ -496,9 +496,9 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) dc->blue2_curve->reset(); sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(dc->blue2_bpath), NULL); - /* if c is empty, it might be that the user was trying to continue an existing curve and cancelled. - if this is the case and we are in bspline or spirolive the previous curve needs to be selected again because - we modify it when continuing through an anchor. */ + //spanish: si c esta vacio, puede ser que se haya tratado de contnuar una curva existente + //y se haya cancelado. Si es asi y el modo es bspline o spirolive la curva previa necesita volver a ser seleccionada + //porque la modificamos al continuar por un anchor if (c->is_empty()) { if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2){ SPDesktop *desktop = dc->desktop; @@ -527,10 +527,8 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) { // We hit bot start and end of single curve, closing paths dc->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Closing path.")); - - /* if we are in bspline or spirolive mode, the continuation and ending curve are updated when continuing or ending the curve in an anchor. - this causes that the original function doesn't detect if it's the same curve in case the curves have multiples parts -shift- and - close incorrectly one of the parts */ + //spanish: si estamos en modo bspline o spirolive, la curva de continuación y finalización es actualizada al continuar o finalizar la curva en un anchor + //esto proboca que la función original no detecte si es la misma curva en el caso de curvas con multiples partes -shift- y cierre de manera erronea una de las partes if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2){ if (dc->sa->start && !(dc->sa->curve->is_closed()) ) { @@ -549,8 +547,8 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) c->unref(); dc->sa->curve->closepath_current(); } - - //if the curve has an bspline or spiro LPE, we execute spdc_flush_white, passing the necessary starting curve. + //spanish: Si la curva tiene un LPE del tipo bspline o spiro ejecutamos spdc_flush_white + //pasándole la curva de inicio necesaria if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2){ dc->white_curves = g_slist_remove(dc->white_curves, dc->sa->curve); @@ -681,8 +679,9 @@ SPDrawAnchor *spdc_test_inside(FreehandBase *dc, Geom::Point p) } } - /* modify the anchoring curve so it is equal to the starting curve. - this curve is modified when it's modified and we need them to be equal to the closing curve */ + //spanish: modificamos la curva de anclaje para que sea igual que la curva de inicio. + //esta curva fue modificada al continuar la curva y necesitamos que sea igual que la curva en + //la que cerramos el trazado. Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if((prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2) && diff --git a/src/ui/tools/node-tool.h b/src/ui/tools/node-tool.h index 42f89cd1c..168ec995a 100644 --- a/src/ui/tools/node-tool.h +++ b/src/ui/tools/node-tool.h @@ -14,8 +14,7 @@ #include <boost/ptr_container/ptr_map.hpp> #include <glib.h> #include "ui/tools/tool-base.h" - -// we need it to call it from Live Effect +//spanish: lo necesitamos para llamarlo desde el Live Effect #include "selection.h" namespace Inkscape { diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index e3bbc72b1..ad77fcb53 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -42,7 +42,7 @@ #include "context-fns.h" #include "tools-switch.h" #include "ui/control-manager.h" -// we include the necessary files for BSpline & Spiro +//spanish: incluimos los archivos necesarios para las BSpline y Spiro #include "live_effects/effect.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" @@ -166,7 +166,7 @@ PenTool::~PenTool() { void PenTool::setPolylineMode() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); guint mode = prefs->getInt("/tools/freehand/pen/freehand-mode", 0); - // change the nodes to make space for bspline mode + //spanish: cambiamos los modos para dar cabida al modo bspline this->polylines_only = (mode == 3 || mode == 4); this->polylines_paraxial = (mode == 4); //we call the function which defines the Spiro modes and the BSpline @@ -178,7 +178,7 @@ void PenTool::setPolylineMode() { *.Set the mode of draw spiro, and bsplines */ void PenTool::_pen_context_set_mode(guint mode) { - // define the nodes + //spanish: definimos los modos this->spiro = (mode == 1); this->bspline = (mode == 2); } @@ -386,7 +386,7 @@ gint PenTool::_handleButtonPress(GdkEventButton const &bevent) { if(bevent.button != 3 && (this->spiro || this->bspline) && this->npoints > 0 && this->p[0] == this->p[3]){ this->state = PenTool::STOP; if( anchor && anchor == this->sa && this->green_curve->is_empty()){ - //remove the following line to avoid having one node on top of another + //spanish Borrar siguiente linea para evitar un nodo encima de otro _finishSegment(event_dt, bevent.state); _finish( FALSE); return TRUE; @@ -512,7 +512,7 @@ gint PenTool::_handleButtonPress(GdkEventButton const &bevent) { } } - // avoid the creation of a control point so a node is created in the release event + //spanish: evitamos la creación de un punto de control para que se cree el nodo en el evento de soltar this->state = (this->spiro || this->bspline || this->polylines_only) ? PenTool::POINT : PenTool::CONTROL; ret = TRUE; @@ -705,7 +705,7 @@ gint PenTool::_handleMotionNotify(GdkEventMotion const &mevent) { default: break; } - // calls the function "bspline_spiro_motion" when the mouse starts or stops moving + //spanish: lanzamos la función "bspline_spiro_motion" al moverse el ratón o cuando se para. if(this->bspline){ this->_bspline_spiro_color(); this->_bspline_spiro_motion(mevent.state & GDK_SHIFT_MASK); @@ -743,7 +743,9 @@ gint PenTool::_handleButtonRelease(GdkEventButton const &revent) { // Test whether we hit any anchor. SPDrawAnchor *anchor = spdc_test_inside(this, event_w); - // if we try to create a node in the same place as another node, we skip + //with this we avoid creating a new point over the existing one + //spanish: si intentamos crear un nodo en el mismo sitio que el origen, paramos. + if((!anchor || anchor == this->sa) && (this->spiro || this->bspline) && this->npoints > 0 && this->p[0] == this->p[3]){ return TRUE; } @@ -758,7 +760,7 @@ gint PenTool::_handleButtonRelease(GdkEventButton const &revent) { p = anchor->dp; } this->sa = anchor; - // continue the existing curve + //spanish: continuamos una curva existente if (anchor) { if(this->bspline || this->spiro){ this->_bspline_spiro_start_anchor(revent.state & GDK_SHIFT_MASK);; @@ -788,7 +790,7 @@ gint PenTool::_handleButtonRelease(GdkEventButton const &revent) { this->_endpointSnap(p, revent.state); } this->_finishSegment(p, revent.state); - // hude the guide of the penultimate node when closing the curve + //spanish: ocultamos la guia del penultimo nodo al cerrar la curva if(this->spiro){ sp_canvas_item_hide(this->c1); } @@ -815,7 +817,7 @@ gint PenTool::_handleButtonRelease(GdkEventButton const &revent) { case PenTool::CLOSE: this->_endpointSnap(p, revent.state); this->_finishSegment(p, revent.state); - // hide the penultimate node guide when closing the curve + //spanish: ocultamos la guia del penultimo nodo al cerrar la curva if(this->spiro){ sp_canvas_item_hide(this->c1); } @@ -906,7 +908,7 @@ void PenTool::_redrawAll() { sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(this->red_bpath), this->red_curve); // handles - // hide the handlers in bspline and spiro modes + //spanish: ocultamos los tiradores en modo bspline y spiro if (this->p[0] != this->p[1] && !this->spiro && !this->bspline) { SP_CTRL(this->c1)->moveto(this->p[1]); this->cl1->setCoords(this->p[0], this->p[1]); @@ -920,7 +922,7 @@ void PenTool::_redrawAll() { Geom::Curve const * last_seg = this->green_curve->last_segment(); if (last_seg) { Geom::CubicBezier const * cubic = dynamic_cast<Geom::CubicBezier const *>( last_seg ); - // hide the handlers in bspline and spiro modes + //spanish: ocultamos los tiradores en modo bspline y spiro if ( cubic && (*cubic)[2] != this->p[0] && !this->spiro && !this->bspline ) { @@ -935,8 +937,9 @@ void PenTool::_redrawAll() { } } - // simply redraw the spiro. because its a redrawing, we don't call the global function, - // but we call the redrawing at the ending. + //spanish: simplemente redibujamos la spiro. + //como es un redibujo simplemente no llamamos a la función global sino al final de esta + //Lanzamos solamente el redibujado this->_bspline_spiro_build(); } @@ -966,12 +969,12 @@ void PenTool::_lastpointMoveScreen(gdouble x, gdouble y) { } void PenTool::_lastpointToCurve() { - // avoid that if the "red_curve" contains only two points ( rect ), it doesn't stop here. + //spanish: evitamos que si la "red_curve" tiene solo dos puntos -recta- no se pare aqui. if (this->npoints != 5 && !this->spiro && !this->bspline) return; Geom::CubicBezier const * cubic; this->p[1] = this->red_curve->last_segment()->initialPoint() + (1./3)* (Geom::Point)(this->red_curve->last_segment()->finalPoint() - this->red_curve->last_segment()->initialPoint()); - //modificate the last segment of the green curve so it creates the type of node we need + //spanish: modificamos el último segmento de la curva verde para que forme el tipo de nodo que deseamos if(this->spiro||this->bspline){ if(!this->green_curve->is_empty()){ Geom::Point A(0,0); @@ -1009,7 +1012,7 @@ void PenTool::_lastpointToCurve() { this->green_curve->append_continuous(previous, 0.0625); } } - //if the last node is an union with another curve + //spanish: si el último nodo es una union con otra curva if(this->green_curve->is_empty() && this->sa && !this->sa->curve->is_empty()){ this->_bspline_spiro_start_anchor(false); } @@ -1020,11 +1023,11 @@ void PenTool::_lastpointToCurve() { void PenTool::_lastpointToLine() { - // avoid that if the "red_curve" contains only two points ( rect) it doesn't stop here. + //spanish: evitamos que si la "red_curve" tiene solo dos puntos -recta- no se pare aqui. if (this->npoints != 5 && !this->bspline) return; - // modify the last segment of the green curve so the type of node we want is created. + //spanish: modificamos el último segmento de la curva verde para que forme el tipo de nodo que deseamos if(this->spiro || this->bspline){ if(!this->green_curve->is_empty()){ Geom::Point A(0,0); @@ -1056,7 +1059,7 @@ void PenTool::_lastpointToLine() { this->green_curve->append_continuous(previous, 0.0625); } } - // if the last node is an union with another curve + //spanish: si el último nodo es una union con otra curva if(this->green_curve->is_empty() && this->sa && !this->sa->curve->is_empty()){ this->_bspline_spiro_start_anchor(true); } @@ -1245,7 +1248,7 @@ gint PenTool::_handleKeyPress(GdkEvent *event) { this->p[1] = this->p[0]; } - // asign the value in a third of the distance of the last segment. + //spanish: asignamos el valor a un tercio de distancia del último segmento. if(this->bspline){ this->p[1] = this->p[0] + (1./3)*(this->p[3] - this->p[0]); } @@ -1255,7 +1258,7 @@ gint PenTool::_handleKeyPress(GdkEvent *event) { : this->p[3])); this->npoints = 2; - // delete the last segment of the green curve + //spanish: eliminamos el último segmento de la curva verde if( this->green_curve->get_segment_count() == 1){ this->npoints = 5; if (this->green_bpaths) { @@ -1267,7 +1270,7 @@ gint PenTool::_handleKeyPress(GdkEvent *event) { }else{ this->green_curve->backspace(); } - // assign the value of this->p[1] to the oposite of the green line last segment + //spanish: asignamos el valor de this->p[1] a el opuesto de el ultimo segmento de la línea verde if(this->spiro){ cubic = dynamic_cast<Geom::CubicBezier const *>(this->green_curve->last_segment()); if ( cubic ) { @@ -1282,8 +1285,7 @@ gint PenTool::_handleKeyPress(GdkEvent *event) { this->state = PenTool::POINT; this->_setSubsequentPoint(pt, true); pen_last_paraxial_dir = !pen_last_paraxial_dir; - - //redraw + //spanish: redibujamos this->_bspline_spiro_build(); ret = TRUE; } @@ -1358,7 +1360,9 @@ void PenTool::_setAngleDistanceStatusMessage(Geom::Point const p, int pc_point_t g_string_free(dist, FALSE); } -// this function changes the colors red, green and blue making them transparent or not, depending on if spiro is being used. + + +//spanish: esta función cambia los colores rojo,verde y azul haciendolos transparentes o no en función de si se usa spiro void PenTool::_bspline_spiro_color() { bool remake_green_bpaths = false; @@ -1732,7 +1736,8 @@ void PenTool::_bspline_spiro_end_anchor_off() } } -//prepares the curves for its transformation into BSpline curve. + +//spanish: preparates the curves for its trasformation into BSline curves. void PenTool::_bspline_spiro_build() { if(!this->spiro && !this->bspline) @@ -1761,7 +1766,7 @@ void PenTool::_bspline_spiro_build() } if(!curve->is_empty()){ - // close the curve if the final points of the curve are close enough + //spanish: cerramos la curva si estan cerca los puntos finales de la curva if(Geom::are_near(curve->first_path()->initialPoint(), curve->last_path()->finalPoint())){ curve->closepath_current(); } @@ -1800,7 +1805,7 @@ void PenTool::_bspline_spiro_build() void PenTool::_bspline_doEffect(SPCurve * curve) { - // commenting the function doEffect in src/live_effects/lpe-bspline.cpp + //spanish: comentado en funcion "doEffect" de src/live_effects/lpe-bspline.cpp if(curve->get_segment_count() < 2) return; Geom::PathVector const original_pathv = curve->get_pathvector(); @@ -1940,7 +1945,7 @@ void PenTool::_bspline_doEffect(SPCurve * curve) } //Spiro function cloned from lpe-spiro.cpp -// commenting the function "doEffect" from src/live_effects/lpe-spiro.cpp +//spanish: comentado en funcion "doEffect" de src/live_effects/lpe-spiro.cpp void PenTool::_spiro_doEffect(SPCurve * curve) { using Geom::X; @@ -2173,7 +2178,7 @@ void PenTool::_finish(gboolean const closed) { desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Drawing finished")); - // cancelate line without a created segment + //spanish para cancelar linea sin un segmento creado this->red_curve->reset(); spdc_concat_colors_and_flush(this, closed); this->sa = NULL; diff --git a/src/ui/tools/pen-tool.h b/src/ui/tools/pen-tool.h index 95565abc9..88e528b22 100644 --- a/src/ui/tools/pen-tool.h +++ b/src/ui/tools/pen-tool.h @@ -49,7 +49,7 @@ public: bool polylines_only; bool polylines_paraxial; - // propiety which saves if Spiro mode is active or not + //spanish: propiedad que guarda si el modo Spiro está activo o no bool spiro; bool bspline; int num_clicks; @@ -88,29 +88,29 @@ private: gint _handleButtonRelease(GdkEventButton const &revent); gint _handle2ButtonPress(GdkEventButton const &bevent); gint _handleKeyPress(GdkEvent *event); - //adds spiro & bspline modes + //spanish: añade los modos spiro y bspline void _pen_context_set_mode(guint mode); - //this function changes the colors red, green and blue making them transparent or not depending on if the function uses spiro + //spanish: esta función cambia los colores rojo,verde y azul haciendolos transparentes o no en función de si se usa spiro void _bspline_spiro_color(); - //creates a node in bspline or spiro modes + //spanish: crea un nodo en modo bspline o spiro void _bspline_spiro(bool shift); - //creates a node in bspline or spiro modes + //spanish: crea un nodo de modo spiro o bspline void _bspline_spiro_on(); - //creates a CUSP node + //spanish: crea un nodo de tipo CUSP void _bspline_spiro_off(); - //continues the existing curve in bspline or spiro mode + //spanish: continua una curva existente en modo bspline o spiro void _bspline_spiro_start_anchor(bool shift); - //continues the existing curve with the union node in bspline or spiro modes + //spanish: continua una curva exsitente con el nodo de union en modo bspline o spiro void _bspline_spiro_start_anchor_on(); - //continues an existing curve with the union node in CUSP mode + //spanish: continua una curva existente con el nodo de union en modo CUSP void _bspline_spiro_start_anchor_off(); - //modifies the "red_curve" when it detects movement + //spanish: modifica la "red_curve" cuando se detecta movimiento void _bspline_spiro_motion(bool shift); - //closes the curve with the last node in bspline or spiro mode + //spanish: cierra la curva con el último nodo en modo bspline o spiro void _bspline_spiro_end_anchor_on(); - //closes the curve with the last node in CUSP mode + //spanish: cierra la curva con el último nodo en modo CUSP void _bspline_spiro_end_anchor_off(); - //CHECK: join all the curves "in game" and we call doEffect function + //spanish: unimos todas las curvas en juego y llamamos a la función doEffect. void _bspline_spiro_build(); //function bspline cloned from lpe-bspline.cpp void _bspline_doEffect(SPCurve * curve); diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index 1ccdee637..bd50672af 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -685,7 +685,7 @@ void PencilTool::_interpolate() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0); for (int c = 0; c < n_segs; c++) { - // if we are in BSpline we modify the trace to create adhoc nodes + //spanish: si el modo es BSpline modificamos para que el trazado cree los nodos adhoc if(mode == 2){ Geom::Point BP = b[4*c+0] + (1./3)*(b[4*c+3] - b[4*c+0]); BP = Geom::Point(BP[X] + 0.0001,BP[Y] + 0.0001); @@ -835,7 +835,7 @@ void PencilTool::_fitAndSplit() { this->red_curve->moveto(b[0]); using Geom::X; using Geom::Y; - // if we are in BSpline we modify the trace to create adhoc nodes + //spanish: si el modo es BSpline modificamos para que el trazado cree los nodos adhoc Inkscape::Preferences *prefs = Inkscape::Preferences::get(); guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0); if(mode == 2){ |
