From da819d069e31ec81d0ef4f6361010b8343e132f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 18 Jul 2007 12:29:44 +0000 Subject: [PATCH] * performance optimization, getting the bounding box of a text is about 10% faster git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21644 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../app/drawing/Painter/font_support/AGGTextRenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp b/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp index 3316e0b120..5619e74a1b 100644 --- a/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp +++ b/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp @@ -177,7 +177,7 @@ AGGTextRenderer::RenderString(const char* string, // "bounds" will track the bounding box arround all glyphs that are actually drawn // it will be calculated in untransformed coordinates within the loop and then // it is transformed to the real location at the exit of the function. - BRect bounds(0.0, 0.0, -1.0, -1.0); + BRect bounds(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); Transformable transform(fEmbeddedTransformation); transform.TranslateBy(baseLine); @@ -249,7 +249,7 @@ AGGTextRenderer::RenderString(const char* string, // track bounding box if (glyphBounds.IsValid()) - bounds = bounds.IsValid() ? bounds | glyphBounds : glyphBounds; + bounds = bounds | glyphBounds; // render the glyph if this is not a dry run if (!dryRun) {