Bug 111088 - EPS diagram export not the same as the diagram itself
Summary: EPS diagram export not the same as the diagram itself
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.4.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-19 16:39 UTC by Filip Miletic
Modified: 2005-09-27 03:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
PATCH Change print resolution for eps files to match those of png etc... (411 bytes, patch)
2005-08-25 23:08 UTC, Peter Soetens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Miletic 2005-08-19 16:39:52 UTC
Version:           1.4.1 (using KDE KDE 3.4.1)
Installed from:    Fedora RPMs
OS:                Linux

An Encapsulated Postscript (EPS) diagram export in Umbrello does not look the same as on the screen, with respect to element alignment.

For instance, make a class diagram, and put a single class named Agent on it. Insert a dependence of Agent upon itself. 

On the screen, the line denoting dependence is a U-formed zig-zag, turning at right angles (90 degrees) at each corner point.

Export the diagram to EPS and look at the output. The dependence line is a zig-zag, but the angles are not 90 degrees.

This error repeats throughout Umbrello EPS exports, making for quite ugly diagrams.

If you make a PNG export, you don't see this problem.

Compare:
http://cobalt.et.tudelft.nl/~filip/files/bug-reports/umbrello/meet-uml-class.png
http://cobalt.et.tudelft.nl/~filip/files/bug-reports/umbrello/meet-uml-class.eps
Comment 1 Peter Soetens 2005-08-25 23:08:59 UTC
Created attachment 12374 [details]
PATCH Change print resolution for eps files to match those of png etc...

This fix is trivial, it switches to screen resolution instead of printer
resolution when saving as eps (and vice versa for other 'print' formats). 
It seems not to break printing the sheet or saving to other formats...

The resulting eps file has the same layout as the screen (WYSIWIG).

Peter
Comment 2 Oliver Kellogg 2005-08-27 21:52:45 UTC
SVN commit 454055 by okellogg:

BUG:111088 - From Peter Soetens 2005-08-25 23:08
> This fix is trivial, it switches to screen resolution instead of printer 
> resolution when saving as eps (and vice versa for other 'print' formats). 
> It seems not to break printing the sheet or saving to other formats... 
> The resulting eps file has the same layout as the screen (WYSIWIG).



 M  +1 -1      ChangeLog  
 M  +1 -1      umbrello/umlview.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #454054:454055
@@ -10,7 +10,7 @@
 
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
  57588  58809  66461  67719  72016  79433  87252  88117  97162 105564
-108223 109591 109636 110216 110231 110379 111470 111502
+108223 109591 109636 110216 110231 110379 111088 111470 111502
 
 Version 1.4.2 (maintenance release)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlview.cpp #454054:454055
@@ -1412,7 +1412,7 @@
     // of the printer (which should be 72dpi here)
     QPrinter *printer;
 
-    if (isEPS == true)
+    if (isEPS == false)
     {
         printer = new QPrinter(QPrinter::PrinterResolution);
     } else {
Comment 3 Peter Soetens 2005-08-28 14:45:57 UTC
The proposed patch is not perfect and the original bug may need an alternate way of fixing. The remaining problem with this patch is that the bounding box of the EPS is too large (wrongly calculated, it takes the screen viewport size !?) thus the drawing is mostly somewhere in the left top corner. Don't have enough XP with QPainter/QPrinter to see how to properly fix it. I propose we look at other KDE projects which export EPS from figures (there are lots).
The fundamental problem though is that lines/widget dimensions are 'stored' in pixels, while fonts in dpi. Generating a drawing on another resolution (ie printer, eps) than the screen resolution skews font-widget metrics, hence cause this bug report. The patch above fixed that by rendering the EPS at screen resolution. 
Comment 4 Alan Ezust 2005-09-27 03:12:05 UTC
I just ran a recent svn checkout and exported to EPS.

It seems that now, I'm getting the proper print resolution for EPS diagrams again, and the diagram edges aren't all screwed up like they were before!
Very nice!