From 4e432e5960cb8bc9feb6648087b54788c774d773 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 11 Mar 2007 21:23:04 +0000 Subject: Eliminate remaining sources of empty NR::Rects (bzr r2605) --- src/widgets/font-selector.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/widgets/font-selector.cpp') diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index 4c84eeb24..bb155fc7c 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -626,11 +626,13 @@ static gint sp_font_preview_expose(GtkWidget *widget, GdkEventExpose *event) hpos[len] = base_pt[0]; len++; if ( curF ) { - NR::Rect nbbox = curF->BBox(str_text->glyph_text[i].gl); - bbox.x0 = MIN(bbox.x0, base_pt[NR::X] + theSize * (nbbox.min())[0]); - bbox.y0 = MIN(bbox.y0, base_pt[NR::Y] - theSize * (nbbox.max())[1]); - bbox.x1 = MAX(bbox.x1, base_pt[NR::X] + theSize * (nbbox.max())[0]); - bbox.y1 = MAX(bbox.y1, base_pt[NR::Y] - theSize * (nbbox.min())[1]); + NR::Maybe nbbox = curF->BBox(str_text->glyph_text[i].gl); + if (nbbox) { + bbox.x0 = MIN(bbox.x0, base_pt[NR::X] + theSize * (nbbox->min())[0]); + bbox.y0 = MIN(bbox.y0, base_pt[NR::Y] - theSize * (nbbox->max())[1]); + bbox.x1 = MAX(bbox.x1, base_pt[NR::X] + theSize * (nbbox->max())[0]); + bbox.y1 = MAX(bbox.y1, base_pt[NR::Y] - theSize * (nbbox->min())[1]); + } } } if ( curF ) { -- cgit v1.2.3