summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2019-02-24 06:13:39 +0000
committerMartin Owens <doctormo@gmail.com>2019-02-24 06:13:39 +0000
commit89dec29933b82615972ab5cb5691df7a445aac6b (patch)
treec3bb2ad8c0beba42805d51f09671a81790e96188 /src/ui
parentMake background color affect checkerboard (diff)
downloadinkscape-89dec29933b82615972ab5cb5691df7a445aac6b.tar.gz
inkscape-89dec29933b82615972ab5cb5691df7a445aac6b.zip
Merge in bazaar branch for alignment handles
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/align-and-distribute.cpp15
-rw-r--r--src/ui/dialog/align-and-distribute.h2
-rw-r--r--src/ui/pixmaps/handles.xpm60
-rw-r--r--src/ui/tools/select-tool.cpp5
4 files changed, 77 insertions, 5 deletions
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index b43afe179..d62ca3ea7 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -106,7 +106,7 @@ void ActionAlign::do_node_action(Inkscape::UI::Tools::NodeTool *nt, int verb)
prefs->setInt("/dialogs/align/align-nodes-to", MIN_NODE );
nt->_multipath->alignNodes(Geom::X);
break;
- case SP_VERB_ALIGN_VERTICAL_HORIZONTAL_CENTER:
+ case SP_VERB_ALIGN_BOTH_CENTER:
nt->_multipath->alignNodes(Geom::X);
nt->_multipath->alignNodes(Geom::Y);
break;
@@ -162,6 +162,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index)
if(focus)
b = focus->desktopPreferredBounds();
+
g_return_if_fail(b);
if (horiz == Selection::HORIZONTAL && desktop->is_yaxisdown()) {
@@ -213,7 +214,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index)
}
-ActionAlign::Coeffs const ActionAlign::_allCoeffs[11] = {
+ActionAlign::Coeffs const ActionAlign::_allCoeffs[19] = {
{1., 0., 0., 0., 0., 1., 0., 0., SP_VERB_ALIGN_HORIZONTAL_RIGHT_TO_ANCHOR},
{1., 0., 0., 0., 1., 0., 0., 0., SP_VERB_ALIGN_HORIZONTAL_LEFT},
{.5, .5, 0., 0., .5, .5, 0., 0., SP_VERB_ALIGN_HORIZONTAL_CENTER},
@@ -224,7 +225,15 @@ ActionAlign::Coeffs const ActionAlign::_allCoeffs[11] = {
{0., 0., .5, .5, 0., 0., .5, .5, SP_VERB_ALIGN_VERTICAL_CENTER},
{0., 0., 1., 0., 0., 0., 1., 0., SP_VERB_ALIGN_VERTICAL_BOTTOM},
{0., 0., 1., 0., 0., 0., 0., 1., SP_VERB_ALIGN_VERTICAL_TOP_TO_ANCHOR},
- {.5, .5, .5, .5, .5, .5, .5, .5, SP_VERB_ALIGN_VERTICAL_HORIZONTAL_CENTER}
+ {1., 0., 0., 1., 1., 0., 0., 1., SP_VERB_ALIGN_BOTH_TOP_LEFT},
+ {0., 1., 0., 1., 0., 1., 0., 1., SP_VERB_ALIGN_BOTH_TOP_RIGHT},
+ {0., 1., 1., 0., 0., 1., 1., 0., SP_VERB_ALIGN_BOTH_BOTTOM_RIGHT},
+ {1., 0., 1., 0., 1., 0., 1., 0., SP_VERB_ALIGN_BOTH_BOTTOM_LEFT},
+ {0., 1., 1., 0., 1., 0., 0., 1., SP_VERB_ALIGN_BOTH_TOP_LEFT_TO_ANCHOR},
+ {1., 0., 1., 0., 0., 1., 0., 1., SP_VERB_ALIGN_BOTH_TOP_RIGHT_TO_ANCHOR},
+ {1., 0., 0., 1., 0., 1., 1., 0., SP_VERB_ALIGN_BOTH_BOTTOM_RIGHT_TO_ANCHOR},
+ {0., 1., 0., 1., 1., 0., 1., 0., SP_VERB_ALIGN_BOTH_BOTTOM_LEFT_TO_ANCHOR},
+ {.5, .5, .5, .5, .5, .5, .5, .5, SP_VERB_ALIGN_BOTH_CENTER}
};
void ActionAlign::do_verb_action(SPDesktop *desktop, int verb)
diff --git a/src/ui/dialog/align-and-distribute.h b/src/ui/dialog/align-and-distribute.h
index 6259736e0..ad23530ec 100644
--- a/src/ui/dialog/align-and-distribute.h
+++ b/src/ui/dialog/align-and-distribute.h
@@ -199,7 +199,7 @@ private :
guint _index;
AlignAndDistribute &_dialog;
- static const Coeffs _allCoeffs[11];
+ static const Coeffs _allCoeffs[19];
};
diff --git a/src/ui/pixmaps/handles.xpm b/src/ui/pixmaps/handles.xpm
index b61ad377c..e16e61bc7 100644
--- a/src/ui/pixmaps/handles.xpm
+++ b/src/ui/pixmaps/handles.xpm
@@ -98,3 +98,63 @@ static char const *handle_center_xpm[] = {
" . ",
" "};
+/* XPM */
+static char const *handle_align_xpm[] = {
+"13 13 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ........... ",
+" .+++++++. ",
+" .+++++. ",
+" .+++. ",
+" .+. ",
+" + ",
+" ........... ",
+" "};
+
+/* XPM */
+static char const *handle_align_center_xpm[] = {
+"13 13 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ......... ",
+" .+++++. ",
+". .+++. .",
+".. .+. ..",
+".+. . .+.",
+".++. . .++.",
+".+++.....+++.",
+".++. . .++.",
+".+. . .+.",
+".. .+. ..",
+". .+++. .",
+" .+++++. ",
+" ......... "};
+
+/* XPM */
+static char const *handle_align_corner_xpm[] = {
+"13 13 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ",
+" . . ",
+" .. . ",
+" .+. . ",
+" .++. . ",
+" .+++. . ",
+" ...... . ",
+" . . ",
+" . . ",
+" .. ",
+" ........... ",
+" "};
+
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp
index 01ede4b6d..93ff8d1d2 100644
--- a/src/ui/tools/select-tool.cpp
+++ b/src/ui/tools/select-tool.cpp
@@ -59,7 +59,7 @@
using Inkscape::DocumentUndo;
-GdkPixbuf *handles[13];
+GdkPixbuf *handles[23];
namespace Inkscape {
namespace UI {
@@ -112,6 +112,9 @@ SelectTool::SelectTool()
sp_load_handles(4, 4, handle_rotate_xpm);
sp_load_handles(8, 4, handle_skew_xpm);
sp_load_handles(12, 1, handle_center_xpm);
+ sp_load_handles(13, 4, handle_align_xpm);
+ sp_load_handles(17, 1, handle_align_center_xpm);
+ sp_load_handles(18, 4, handle_align_corner_xpm);
}
//static gint xp = 0, yp = 0; // where drag started