diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2019-08-02 16:50:27 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-08-02 21:26:28 +0000 |
| commit | 82067a12a334c7ada0a4f61089c645f376740544 (patch) | |
| tree | f220a16b905534e71d95d4e64d9d0aa423beee1a /src/ui/tools | |
| parent | Allow tools sensitive when overflow canvas area also fix a bug i couldent rem... (diff) | |
| download | inkscape-82067a12a334c7ada0a4f61089c645f376740544.tar.gz inkscape-82067a12a334c7ada0a4f61089c645f376740544.zip | |
Remove line height code and ficx coding style
Diffstat (limited to 'src/ui/tools')
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/text-tool.h | 2 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 14 |
3 files changed, 8 insertions, 18 deletions
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index 6bc560869..b8d66817b 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -258,15 +258,13 @@ bool TextTool::item_handler(SPItem* item, GdkEvent* event) { SPItem *item_ungrouped; gint ret = FALSE; + sp_text_context_validate_cursor_iterators(this); Inkscape::Text::Layout::iterator old_start = this->text_sel_start; switch (event->type) { case GDK_BUTTON_PRESS: if (event->button.button == 1 && !this->space_panning) { - // this var allow too much lees suvelection queries - // reducing it to cursor iteracion, mouseup and down - pressed = true; // find out clicked item, disregarding groups item_ungrouped = desktop->getItemAtPoint(Geom::Point(event->button.x, event->button.y), TRUE); if (SP_IS_TEXT(item_ungrouped) || SP_IS_FLOWTEXT(item_ungrouped)) { @@ -282,11 +280,9 @@ bool TextTool::item_handler(SPItem* item, GdkEvent* event) { this->text_sel_start = this->text_sel_end = sp_te_get_position_by_coords(this->text, p); } // update display - pressed = false; sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); this->dragging = 1; - pressed = true; } ret = TRUE; } @@ -322,8 +318,6 @@ bool TextTool::item_handler(SPItem* item, GdkEvent* event) { this->dragging = 0; sp_event_context_discard_delayed_snap_event(this); ret = TRUE; - pressed = false; - desktop->emitToolSubselectionChanged((gpointer)this); } break; case GDK_MOTION_NOTIFY: @@ -696,8 +690,6 @@ bool TextTool::root_handler(GdkEvent* event) { } } this->creating = false; - this->pressed = false; - desktop->emitToolSubselectionChanged((gpointer)this); return TRUE; } break; diff --git a/src/ui/tools/text-tool.h b/src/ui/tools/text-tool.h index 361d86f77..96c97c418 100644 --- a/src/ui/tools/text-tool.h +++ b/src/ui/tools/text-tool.h @@ -68,7 +68,7 @@ public: bool over_text; // true if cursor is over a text object guint dragging : 2; // dragging selection over text - bool pressed; + bool creating; // dragging rubberband to create flowtext SPCanvasItem *grabbed; // we grab while we are creating, to get events even if the mouse goes out of the window Geom::Point p0; // initial point if the flowtext rect diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index cadce0c0d..4d30740c9 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -1076,14 +1076,12 @@ void sp_event_context_read(ToolBase *ec, gchar const *key) { gint sp_event_context_root_handler(ToolBase * event_context, GdkEvent * event) { - Geom::Point pos = Geom::Point(0,0); - if ((event->type == GDK_BUTTON_RELEASE || - event->type == GDK_MOTION_NOTIFY) && - !event_context->desktop->canvas->_inside) - { - pos = event_context->desktop->d2w(event_context->desktop->point(true)); - event->motion.x = pos[Geom::X]; - event->motion.y = pos[Geom::Y]; + Geom::Point pos = Geom::Point(0, 0); + if ((event->type == GDK_BUTTON_RELEASE || event->type == GDK_MOTION_NOTIFY) && + !event_context->desktop->canvas->_inside) { + pos = event_context->desktop->d2w(event_context->desktop->point(true)); + event->motion.x = pos[Geom::X]; + event->motion.y = pos[Geom::Y]; } if (!event_context->_uses_snap) { |
