summaryrefslogtreecommitdiffstats
path: root/src/ui
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
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')
-rw-r--r--src/ui/control-manager.cpp14
-rw-r--r--src/ui/control-manager.h3
2 files changed, 17 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);
diff --git a/src/ui/control-manager.h b/src/ui/control-manager.h
index 4abb03e43..05a53f6a0 100644
--- a/src/ui/control-manager.h
+++ b/src/ui/control-manager.h
@@ -19,6 +19,7 @@
struct SPCanvasGroup;
struct SPCanvasItem;
struct SPCtrlLine;
+struct SPCtrlCurve;
namespace Geom
{
@@ -54,6 +55,8 @@ public:
SPCtrlLine *createControlLine(SPCanvasGroup *parent, Geom::Point const &p1, Geom::Point const &p2, CtrlLineType type = CTLINE_PRIMARY);
+ SPCtrlCurve *createControlCurve(SPCanvasGroup *parent, Geom::Point const &p0, Geom::Point const &p1, Geom::Point const &p2, Geom::Point const &p3, CtrlLineType type = CTLINE_PRIMARY);
+
void track(SPCanvasItem *item);
void updateItem(SPCanvasItem *item);