summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2019-09-11 09:42:16 +0000
committerJabiertxof <jabier.arraiza@marker.es>2019-09-11 09:42:16 +0000
commit0a78936f89257606fbf86ad64722c560cce24005 (patch)
tree5f42b1fa9ae5e679fcc64000cba87bef1bb99cbf /src/display
parentFix issue https://gitlab.com/inkscape/inbox/issues/841 Crash on selecting cer... (diff)
downloadinkscape-0a78936f89257606fbf86ad64722c560cce24005.tar.gz
inkscape-0a78936f89257606fbf86ad64722c560cce24005.zip
Fix crash when font dont have X glyph. Solve this https://gitlab.com/inkscape/inbox/issues/841
Diffstat (limited to 'src/display')
-rw-r--r--src/display/drawing-text.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp
index 6ec04ca01..46d05d399 100644
--- a/src/display/drawing-text.cpp
+++ b/src/display/drawing-text.cpp
@@ -122,9 +122,12 @@ unsigned DrawingGlyphs::_updateItem(Geom::IntRect const &/*area*/, UpdateContext
*/
Geom::OptRect pb;
- if(_drawable){
- pb = bounds_exact_transformed(*_font->PathVector(42), ctx.ctm); //we fix to "X" char to allow always a reasonable bbox
- pb->expandBy(pb->height()/20.0); //we scale a bit the area to in between char gaps mainly
+ if (_drawable) {
+ Geom::PathVector *glyphv = _font->PathVector(42); //we fix to "X" char to allow always a reasonable bbox
+ if (glyphv && !glyphv->empty()) {
+ pb = bounds_exact_transformed(*glyphv, ctx.ctm);
+ pb->expandBy(pb->height()/10.0); //we scale a bit the area to in between char gaps mainly
+ }
}
if(!pb){ // Fallback, spaces mostly, this never happendd with fixed gliph
Geom::Rect pbigbox(Geom::Point(0.0, _asc*scale_bigbox*0.66),Geom::Point(_width*scale_bigbox, 0.0));