diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-11 21:23:04 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-11 21:23:04 +0000 |
| commit | 4e432e5960cb8bc9feb6648087b54788c774d773 (patch) | |
| tree | f83b7730dfb4ff96d45fb96e83367ab3dc28e56f /src/widgets/font-selector.cpp | |
| parent | Switch selection bounds and center to use NR::Maybe, addressing most of the (diff) | |
| download | inkscape-4e432e5960cb8bc9feb6648087b54788c774d773.tar.gz inkscape-4e432e5960cb8bc9feb6648087b54788c774d773.zip | |
Eliminate remaining sources of empty NR::Rects
(bzr r2605)
Diffstat (limited to 'src/widgets/font-selector.cpp')
| -rw-r--r-- | src/widgets/font-selector.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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<NR::Rect> 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 ) { |
