summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 283b476)
raw | patch | inline | side by side (parent: 283b476)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 16 Feb 2009 01:16:56 +0000 (01:16 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 16 Feb 2009 01:16:56 +0000 (01:16 +0000) |
src/select-context.cpp | patch | blob | history | |
src/tools-switch.cpp | patch | blob | history | |
src/tools-switch.h | patch | blob | history |
diff --git a/src/select-context.cpp b/src/select-context.cpp
index fd4e132e1798cb054553f5e483a14b881916c90e..0e35c6546fedb1accef8f3cd36ffdfc1125efd8b 100644 (file)
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
sp_canvas_end_forced_full_redraws(desktop->canvas);
} else { // switch tool
- tools_switch_by_item (desktop, clicked_item);
+ Geom::Point const button_pt(event->button.x, event->button.y);
+ Geom::Point const p(desktop->w2d(button_pt));
+ tools_switch_by_item (desktop, clicked_item, p);
}
} else {
sp_select_context_up_one_layer(desktop);
diff --git a/src/tools-switch.cpp b/src/tools-switch.cpp
index f10b86f6404c1110a1af7d948043d14bff2457c3..9fbc966c621daa73173c1159e47ce8a4f5029927 100644 (file)
--- a/src/tools-switch.cpp
+++ b/src/tools-switch.cpp
}
}
-void tools_switch_by_item(SPDesktop *dt, SPItem *item)
+void tools_switch_by_item(SPDesktop *dt, SPItem *item, Geom::Point const p)
{
if (SP_IS_RECT(item)) {
tools_switch(dt, TOOLS_SHAPES_RECT);
}
} else if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) {
tools_switch(dt, TOOLS_TEXT);
+ sp_text_context_place_cursor_at (SP_TEXT_CONTEXT(dt->event_context), SP_OBJECT(item), p);
} else if (SP_IS_OFFSET(item)) {
tools_switch(dt, TOOLS_NODES);
}
diff --git a/src/tools-switch.h b/src/tools-switch.h
index 38b83b226329f6505293c6477db5a257aafc3058..36dd8f80bac69a3f135d3d80d108933b9d9cdc1e 100644 (file)
--- a/src/tools-switch.h
+++ b/src/tools-switch.h
int tools_isactive(SPDesktop *dt, unsigned num);
int tools_active(SPDesktop *dt);
void tools_switch(SPDesktop *dt, int num);
-void tools_switch_by_item (SPDesktop *dt, SPItem *item);
+void tools_switch_by_item (SPDesktop *dt, SPItem *item, Geom::Point const p);
#endif /* !SEEN_TOOLS_SWITCH_H */