I added a note item to my Use Case diagram. I have set the text to "Opt-in?", but in order to make the text visible, I had to resize (widen) the note. After clicking printing/print preview, Umbrello resets the size of all note items to the default size and thus the text is not visible anymore. Reproducible: Always Steps to Reproduce: 1. Add a Note item to a Use Case diagram 2. Change text to "Opt-in?" (or anything else) 3. Resize the Note item until text is visible 4. Open print preview Actual Results: Note items are resized to default size, text is not visible. Expected Results: Do not change size of a Note item, in order to keep the text visible in printouts Umbrello UML Modeller Version 2.8.2 Using KDE Development Platform 4.8.2 (4.8.2)
Created attachment 70586 [details] Screenshots of Note items
Same issue with Box items, too.
The problem is caused by the implementation of UMLWidget::updateComponentSize(), which casts the widget size to the minimum size of the widget. This is the related call stack: umbrello.exe!UMLWidget::updateComponentSize() Zeile 1298 C++ umbrello.exe!UMLWidget::forceUpdateFontMetrics(QPainter * painter) Zeile 1447 C++ umbrello.exe!UMLScene::forceUpdateWidgetFontMetrics(QPainter * painter) Zeile 3885 C++ umbrello.exe!UMLScene::print(QPrinter * pPrinter, QPainter & pPainter) Zeile 516 C++ umbrello.exe!UMLDoc::print(QPrinter * pPrinter, DiagramPrintPage * selectPage) Zeile 2570 C++ umbrello.exe!UMLApp::slotPrintPreviewPaintRequested(QPrinter * printer) Zeile 1323 C++ I changed the implementation of updateComponentSize() to /** * Update the size of this widget. */ void UMLWidget::updateComponentSize() { if (m_doc->loading()) return; - QSize size = minimumSize(); - setSize(size.width(), size.height()); + clipSize(); adjustAssocs(x(), y()); // adjust assoc lines } which is a workaround for this issue.
Further digging shows the real problem which is located in minimumSize(): UMLSceneSize NoteWidget::minimumSize() { int width = 60; int height = 30; if (....) ... else { // keep width and height unchanged } return UMLSceneSize(width, height); } For default notes the size is mapped to hardcoded values instead of leaving unchanged as indicated by the comment.
*** This bug has been marked as a duplicate of bug 152757 ***