/* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2009 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "ui/tool/curve-drag-point.h"
#include "desktop.h"
#include "ui/tool/control-point-selection.h"
#include "ui/tool/event-utils.h"
#include "ui/tool/multi-path-manipulator.h"
#include "ui/tool/path-manipulator.h"
#include "sp-namedview.h"
#include "snap.h"
namespace Inkscape {
namespace UI {
ControlPoint(pm._multi_path_manipulator._path_data.node_data.desktop, Geom::Point(), SP_ANCHOR_CENTER,
{
setVisible(false);
}
{
// do not process any events when the manipulator is empty
setVisible(false);
return false;
}
}
{
// move the handles to 1/3 the length of the segment for line segments
_segment_was_degenerate = true;
// delta is a vector equal 1/3 of distance from first to second
// only update the nodes if the mode is bspline
if(!_pm._isBSpline()){
}
} else {
_segment_was_degenerate = false;
}
return false;
}
{
// special cancel handling - retract handles when if the segment was degenerate
return;
}
m.unSetup();
}
// Magic Bezier Drag Equations follow!
// "weight" describes how the influence of the drag should be distributed
// among the handles; 0 = front handle only, 1 = back handle only.
else weight = 1;
//modified so that, if the trace is bspline, it only acts if the SHIFT key is pressed
if(!_pm._isBSpline()){
}else if(weight>=0.8){
if(held_shift(*event)){
} else {
}
}else if(weight<=0.2){
if(held_shift(*event)){
} else {
}
}else{
}
}
{
}
{
// This check is probably redundant
// the next iterator can be invalid if we click very near the end of path
if (!second) return false;
// insert nodes on Ctrl+Alt+click
_insertNode(false);
return true;
}
if (held_shift(*event)) {
// if both nodes of the segment are selected, deselect;
// otherwise add to selection
} else {
}
} else {
// without Shift, take selection
}
return true;
}
{
_insertNode(true);
return true;
}
{
// The purpose of this call is to make way for the just created node.
// Otherwise clicks on the new node would only work after the user moves the mouse a bit.
// PathManipulator will restore visibility when necessary.
setVisible(false);
}
{
return C_("Path segment tip",
"<b>Shift</b>: drag to open or move BSpline handles");
}
if (state_held_shift(state)) {
return C_("Path segment tip",
"<b>Shift</b>: click to toggle segment selection");
}
return C_("Path segment tip",
"<b>Ctrl+Alt</b>: click to insert a node");
}
if(_pm._isBSpline()){
return C_("Path segment tip",
"<b>BSpline segment</b>: drag to shape the segment, doubleclick to insert node, "
"click to select (more: Shift, Ctrl+Alt)");
}
if (linear) {
return C_("Path segment tip",
"<b>Linear segment</b>: drag to convert to a Bezier segment, "
"doubleclick to insert node, click to select (more: Shift, Ctrl+Alt)");
} else {
return C_("Path segment tip",
"<b>Bezier segment</b>: drag to shape the segment, doubleclick to insert node, "
"click to select (more: Shift, Ctrl+Alt)");
}
}
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :