[Uml-devel] KDE/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Aug 30 10:23:09 UTC 2008
SVN commit 854787 by okellogg:
getAssocLineRectangle(): Do computation of pen_width outside loop.
M +8 -9 associationwidget.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #854786:854787
@@ -3229,16 +3229,20 @@
QRect AssociationWidget::getAssocLineRectangle()
{
QRect rectangle;
- QPoint p;
- uint pen_width;
/* we also want the end points connected to the other widget */
int pos = m_LinePath.count();
+ /* the lines have the width of the pen */
+ uint pen_width = m_LinePath.getPen().width();
+
+ if (pen_width == 0)
+ pen_width = 1; // width must be at least 1
+
/* go through all points on the linepath */
- for( int i=0 ; i < (int) pos; i++ )
+ for (int i = 0; i < pos; i++)
{
- p = m_LinePath.getPoint( i );
+ QPoint p = m_LinePath.getPoint(i);
/* the first point is our starting point */
if (i == 0) {
@@ -3246,11 +3250,6 @@
continue;
}
- /* the lines have the width of the pen */
- pen_width = m_LinePath.getPen().width();
- if (pen_width == 0)
- pen_width = 1; // width must be at least 1
-
if (p.x() < rectangle.x())
rectangle.setX(p.x());
if (p.y() < rectangle.y())
More information about the umbrello-devel
mailing list