Summary: | Note widgets get resized when printing | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Andrew Fuller <mactalla.obair> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | floeschie, ischdoepperdodrausse, johnny, michael.cognacc, oleksiy.shchukin, ralf.habacker, thanson |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.9.0 | |
Attachments: | rough patch |
Description
Andrew Fuller
2007-11-23 01:12:48 UTC
Created attachment 22164 [details]
rough patch
This is a rough patch that Works For Me. It works by returning the current
size in calculateSize (which feels like a hack, perhaps someone who knows how
this stuff works can suggest something better). I'm not familiar with any of
the note types (precondition, etc), so this only happens for Normal notes.
Secondly, to permit manual resizing, UMLWidget::constrain is overridden and
turned into a no-op, otherwise calculateSize is used as minimum size and we
cannot shrink the notes.
Haven't tested the patch, but Notes are definitely unusable when printed in umbrello 1.5.8. Notes and Boxes are both affected by this for me in both Umbrello 1.5.8 and Umbrello 2. The images created when exporting as DocBook work correctly, so there's a workaround of sorts. I'm currently unable to test the patch. This bug still happens with umbrello 2.1.2. Confirmed with v2.2.1 on Fedora 10. It doesn't matter which way I print it. In my case, it's actually changing the working file as I print it, but the program doesn't notice that it's been modified e.g. title bar notification. Still exists in 2.3.2. For CombinedFragment, text boxes, etc. calculateSize determines the "appropriate" size based on the text contents of the element. This is an invalid assumption for elements such as CombinedFragment which are sized by the user to bound part of the diagram. *** Bug 298655 has been marked as a duplicate of this bug. *** *** Bug 153900 has been marked as a duplicate of this bug. *** Setting #153900 as duplicate of this bug do add an empty note without the reference to this bug - a bug in the bug tracker ? *** Bug 189749 has been marked as a duplicate of this bug. *** SVN commit 1298057 by habacker: Changed widget auto resizing to noop for now, because minimumSize() do not work in all cases and need to be refactored. M +1 -2 umlwidget.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1298057 Reopened because further testing shows that some widgets (for example ClassifierWidget and ActorWidget depends on content related minimumSize for getting initial size on widget construction). The lets me assume that NoteWidget::minimalSize should return content related size for the default note type as it is done for the special note widget types. But what about the above mentioned "wrong" assumption ? A fix for the note widget is to add an additional virtual calculateSize() method wich return content based bounding box, which is used in UMLWidget::updateComponentSize(). The widget size will be limited to the lower or upper bounds when these limits are exceeded. /** * Update the size of this widget. */ void UMLWidget::updateComponentSize() { if (m_doc->loading()) return; QSize size = calculateSize(); int clipWidth = size.width(); int clipHeight = size.height(); constrain(clipWidth, clipHeight); setSize(clipWidth, clipHeight); adjustAssocs(x(), y()); // adjust assoc lines } SVN commit 1298923 by habacker: Separated minimum size calculation from content related to fix issues with widget construction size. M +36 -1 notewidget.cpp M +1 -0 notewidget.h M +15 -1 umlwidget.cpp M +2 -0 umlwidget.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1298923 apply fixed bug from 4.9.0 changelog |