diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2014-07-15 23:07:09 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2014-07-15 23:07:09 +0000 |
| commit | 70fbc57aa2ae064f92fbc4e6c8950b5c90e4ccac (patch) | |
| tree | d1f6261e0b50f36714d7b344fb0a7fc596dbcc19 /src/display/drawing-text.cpp | |
| parent | autogen: Check for autopoint before attempting to run it (diff) | |
| download | inkscape-70fbc57aa2ae064f92fbc4e6c8950b5c90e4ccac.tar.gz inkscape-70fbc57aa2ae064f92fbc4e6c8950b5c90e4ccac.zip | |
Warnings cleaup.
(bzr r13454)
Diffstat (limited to 'src/display/drawing-text.cpp')
| -rw-r--r-- | src/display/drawing-text.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index 05a2c3c2a..9f3b447df 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -150,25 +150,26 @@ unsigned DrawingGlyphs::_updateItem(Geom::IntRect const &/*area*/, UpdateContext return STATE_ALL; } -DrawingItem * -DrawingGlyphs::_pickItem(Geom::Point const &p, double delta, unsigned /*flags*/) +DrawingItem *DrawingGlyphs::_pickItem(Geom::Point const &p, double /*delta*/, unsigned /*flags*/) { DrawingText *ggroup = dynamic_cast<DrawingText *>(_parent); if (!ggroup) { throw InvalidItemException(); } + DrawingItem *result = NULL; bool invisible = (ggroup->_nrstyle.fill.type == NRStyle::PAINT_NONE) && (ggroup->_nrstyle.stroke.type == NRStyle::PAINT_NONE); - if (!_font || !_bbox || (!_drawing.outline() && invisible) ) { - return NULL; - } - // With text we take a simple approach: pick if the point is in a character bbox - Geom::Rect expanded(_pick_bbox); - // FIXME, why expand by delta? When is the next line needed? - // expanded.expandBy(delta); - if (expanded.contains(p)) return this; - return NULL; + if (_font && _bbox && (_drawing.outline() || !invisible) ) { + // With text we take a simple approach: pick if the point is in a character bbox + Geom::Rect expanded(_pick_bbox); + // FIXME, why expand by delta? When is the next line needed? + // expanded.expandBy(delta); + if (expanded.contains(p)) { + result = this; + } + } + return result; } |
