summaryrefslogtreecommitdiffstats
path: root/src/select-context.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-07-05 16:40:24 +0000
committerJaviertxo <jtx@jtx.marker.es>2013-07-05 16:40:24 +0000
commitc047b74f459d138e15ec503721edbc7bec308fce (patch)
tree729d8608a99d2453588056f9a690ef7c97baf045 /src/select-context.cpp
parentUpdate to trunk (diff)
parentMerge: Add Hershey extension for engraving fonts (diff)
downloadinkscape-c047b74f459d138e15ec503721edbc7bec308fce.tar.gz
inkscape-c047b74f459d138e15ec503721edbc7bec308fce.zip
Update to trunk
(bzr r11950.1.124)
Diffstat (limited to 'src/select-context.cpp')
-rw-r--r--src/select-context.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/select-context.cpp b/src/select-context.cpp
index 3df047368..b4b01bf15 100644
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
@@ -91,6 +91,16 @@ sp_select_context_class_init(SPSelectContextClass *klass)
event_context_class->item_handler = sp_select_context_item_handler;
}
+//Creates rotated variations for handles
+static void
+sp_load_handles(int start, int count, char const **xpm) {
+ handles[start] = gdk_pixbuf_new_from_xpm_data((gchar const **)xpm);
+ for(int i = start + 1; i < start + count; i++) {
+ // We use either the original at *start or previous loop item to rotate
+ handles[i] = gdk_pixbuf_rotate_simple(handles[i-1], GDK_PIXBUF_ROTATE_CLOCKWISE);
+ }
+}
+
static void
sp_select_context_init(SPSelectContext *sc)
{
@@ -111,19 +121,11 @@ sp_select_context_init(SPSelectContext *sc)
CursorSelectMouseover = sp_cursor_new_from_xpm(cursor_select_m_xpm , 1, 1);
CursorSelectDragging = sp_cursor_new_from_xpm(cursor_select_d_xpm , 1, 1);
// selection handles
- handles[0] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_nw_xpm);
- handles[1] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_ne_xpm);
- handles[2] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_h_xpm);
- handles[3] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_v_xpm);
- handles[4] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_nw_xpm);
- handles[5] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_n_xpm);
- handles[6] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_ne_xpm);
- handles[7] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_e_xpm);
- handles[8] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_se_xpm);
- handles[9] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_s_xpm);
- handles[10] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_sw_xpm);
- handles[11] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_w_xpm);
- handles[12] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_center_xpm);
+ sp_load_handles(0, 2, handle_scale_xpm);
+ sp_load_handles(2, 2, handle_stretch_xpm);
+ sp_load_handles(4, 4, handle_rotate_xpm);
+ sp_load_handles(8, 4, handle_skew_xpm);
+ sp_load_handles(12, 1, handle_center_xpm);
}
static void