Bug 104637 - export class diagramm to eps draws interfaces too small
Summary: export class diagramm to eps draws interfaces too small
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-27 12:08 UTC by Matthias Kempka
Modified: 2005-05-12 08:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kempka 2005-04-27 12:08:43 UTC
Version:           1.3.2 (from distribution),  1.4.0 (compiled from source) (using KDE KDE 3.3.2)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc (GCC) 3.3.5 (Debian 1:3.3.5-8) 
OS:                Linux

1. create a new class diagramm
2. add an interface MyInterface
3. create 3 operations myOperationN

export the diagram as eps and have a look at it.

When I do this, the bottom line of the interface box is higher than the last operation name or goes through it. This seems to be independent of the used font or font size, although the actual cut differs for different font(size)s.
Comment 1 Oliver Kellogg 2005-05-12 08:13:24 UTC
SVN commit 412607 by okellogg:

drawAsConcept(): Use UMLWidget::getFontMetrics() for fontHeight determination.
BUG:104637


 M  +1 -1      trunk/KDE/kdesdk/umbrello/ChangeLog  
 M  +20 -21    trunk/KDE/kdesdk/umbrello/umbrello/interfacewidget.cpp  


--- trunk/KDE/kdesdk/umbrello/ChangeLog #412606:412607
@@ -13,7 +13,7 @@
 * Crash in UMLView::createAutoAttributeAssociations()
 * Bugs from http://bugs.kde.org :
  53376  57667  57875  70924  80924  89691  95353 100290 100307 101148
-103123 103133 103728 101541
+103123 103133 103728 101541 104637
 
 Version 1.4
 
--- trunk/KDE/kdesdk/umbrello/umbrello/interfacewidget.cpp #412606:412607
@@ -92,53 +92,52 @@
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void InterfaceWidget::drawAsConcept(QPainter& p, int offsetX, int offsetY) {
-	ClassifierWidget::draw(p, offsetX, offsetY);
+	ClassifierWidget::draw(p, offsetX, offsetY);  // draw templates
 
 	QFont font = UMLWidget::getFont();
 	font.setItalic(false);
 	font.setUnderline(false);
 	font.setBold(false);
-	QFontMetrics fontMetrics(font);
-	int fontHeight = fontMetrics.lineSpacing();
-	QString name;
-	if ( m_bShowPackage ) {
-		name = m_pObject -> getPackage() + "." + this -> getName();
-	} else {
-		name = this -> getName();
-	}
+	QFontMetrics fontMetrics = UMLWidget::getFontMetrics(UMLWidget::FT_NORMAL);
+	const int fontHeight = fontMetrics.lineSpacing();
+	const int w = m_w - ClassifierWidget::MARGIN * 2;
+	const int x = offsetX + ClassifierWidget::MARGIN;
+	int y = m_bodyOffsetY;
 
 	p.setPen(QPen(black));
 
+	// draw stereotype
 	font.setBold(true);
 	p.setFont(font);
-	p.drawText(offsetX + ClassifierWidget::MARGIN, m_bodyOffsetY,
-		   m_w - ClassifierWidget::MARGIN * 2,fontHeight,
-		   AlignCenter, m_pObject->getStereotype());
+	p.drawText(x, y, w, fontHeight, AlignCenter, m_pObject->getStereotype());
+	y += fontHeight;
 
+	// draw name
+	QString name;
+	if ( m_bShowPackage ) {
+		name = m_pObject -> getPackage() + "." + this -> getName();
+	} else {
+		name = this -> getName();
+	}
 	font.setItalic( m_pObject -> getAbstract() );
 	//FIXME why is underline sometimes true
 	font.setUnderline( false );
 	p.setFont(font);
-	p.drawText(offsetX + ClassifierWidget::MARGIN, m_bodyOffsetY + fontHeight,
-		   m_w - ClassifierWidget::MARGIN * 2, fontHeight, AlignCenter, name);
+	p.drawText(x, y, w, fontHeight, AlignCenter, name);
 	font.setBold(false);
 	font.setItalic(false);
 	p.setFont(font);
+	y += fontHeight;
 
 	if ( m_bShowOperations ) {
 		QFont font = UMLWidget::getFont();
 		font.setItalic(false);
 		font.setUnderline(false);
 		font.setBold(false);
-
-		UMLWidget::draw(p, offsetX, m_bodyOffsetY);
-
-		const int operationsStart = fontHeight * 2;
-		const int y = m_bodyOffsetY + operationsStart;
+		UMLWidget::draw(p, offsetX, m_bodyOffsetY);  // sets the pen
 		p.drawLine(offsetX, y, offsetX + m_w - 1, y);
 		p.setPen( QPen(black) );
-		drawMembers(p, Uml::ot_Operation, m_ShowOpSigs,
-			    offsetX + ClassifierWidget::MARGIN, y, fontHeight);
+		drawMembers(p, Uml::ot_Operation, m_ShowOpSigs, x, y, fontHeight);
 	}//end if op
 
 	if (m_bSelected) {