summaryrefslogtreecommitdiffstats
path: root/src/ui/control-manager.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2012-05-21 13:59:02 +0000
committertavmjong-free <tavmjong@free.fr>2012-05-21 13:59:02 +0000
commitcf7f6d596f7aec4b2775428db2196613de4feb7d (patch)
tree2b4b0a6801b09bc62348213804c51fb2c7cfd460 /src/ui/control-manager.cpp
parentAdd a few new icons for meshes. (diff)
downloadinkscape-cf7f6d596f7aec4b2775428db2196613de4feb7d.tar.gz
inkscape-cf7f6d596f7aec4b2775428db2196613de4feb7d.zip
Added sp-ctrlcurve, usefull for meshes.
(bzr r11395)
Diffstat (limited to 'src/ui/control-manager.cpp')
-rw-r--r--src/ui/control-manager.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/control-manager.cpp b/src/ui/control-manager.cpp
index 124e591a8..6bd2d6fd8 100644
--- a/src/ui/control-manager.cpp
+++ b/src/ui/control-manager.cpp
@@ -20,6 +20,7 @@
#include "display/sodipodi-ctrl.h" // for SP_TYPE_CTRL
#include "display/sp-canvas-item.h"
#include "display/sp-ctrlline.h"
+#include "display/sp-ctrlcurve.h"
#include "display/sp-ctrlpoint.h"
#include "preferences.h"
@@ -423,6 +424,19 @@ SPCtrlLine *ControlManager::createControlLine(SPCanvasGroup *parent, Geom::Point
return line;
}
+SPCtrlCurve *ControlManager::createControlCurve(SPCanvasGroup *parent, Geom::Point const &p0, Geom::Point const &p1, Geom::Point const &p2, Geom::Point const &p3, CtrlLineType type)
+{
+ SPCtrlCurve *line = SP_CTRLCURVE(sp_canvas_item_new(parent, SP_TYPE_CTRLCURVE, NULL));
+ if (line) {
+ line->ctrlType = CTRL_TYPE_LINE;
+
+ line->setRgba32((type == CTLINE_PRIMARY) ? LINE_COLOR_PRIMARY :
+ (type == CTLINE_SECONDARY) ? LINE_COLOR_SECONDARY : LINE_COLOR_TERTIARY);
+ line->setCoords(p0, p1, p2, p3);
+ }
+ return line;
+}
+
void ControlManager::track(SPCanvasItem *item)
{
_impl->track(item);