Bug #50244 Serious printing bug with tables inside layers.
Submitted: 11 Jan 2010 15:53 Modified: 22 Jan 2010 2:29
Reporter: David Peace Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.11 OS:Windows
Assigned to: CPU Architecture:Any
Tags: foreign keys, layers, printing

[11 Jan 2010 15:53] David Peace
Description:
When you place tables inside layers, they will always automatically be placed at the top-left of the document when you attempt to print, or export as PDF etc...

This is a very serious issue, as it makes printing visually separated data impossible.  All the tables will stack on top of each other on the top-left of the document, while the layers and foreign key lines stay in their proper positions.

How to repeat:
1) Create a new EER Diagram.
2) Draw a new layer on the top-left of the diagram.
3) Draw a new layer on the bottom-right of the diagram.
4) Create a new table inside the top-left layer, with one column (id).
5) Create a new table inside the bottom-right layer, with one column (id).
6) Draw a foreign key between the 2 tables.
7) Export as PDF, or even just do a print preview to see what will happen.  Both tables will pop to the top-left of the printed (or PDF) page.  The layers and foreign keys will appear fine.

- Further Verification of issue -
8) Delete the bottom-right layer
9) Export a PDF
10) You will notice that the top-left table has been offset to the top-left still, but the bottom-right table is now in it's proper position.  By deleting the bottom-right layer, the table will now print\export in the correct location.

- Even more verification -
10) Remove the top-left layer
11) Export a PDF
12) All the tables\foreign keys are in their proper places.

Conclusion:
Layers cause the tables to print\export in the wrong X\Y coordinate.

Suggested fix:
Ensure that printing & exporting PDFs is accurate to the diagram with layers.  Layers specifically are there for the visual separation of data, and a bug with printing\exporting diagrams WITH layers kind of defeats the purpose.
[11 Jan 2010 15:57] David Peace
Here is an example of a problem file.  Attempting to print\export this causes the bottom-right table to move to the top-left.

Attachment: example_bad_layers.mwb (application/octet-stream, text), 5.73 KiB.

[11 Jan 2010 15:59] David Peace
Example of exported diagram to PDF format.  You'll notice the bottom-right table moved to the top-left.

Attachment: example_bad_layers.pdf (application/pdf, text), 29.70 KiB.

[11 Jan 2010 16:05] David Peace
Upon further investigation it appears that the tables are being placed at the same X\Y coordinate as they are IN the layer.  Meaning if I place the table at an X,Y of 0,0 INSIDE the layer, it will instead appear at the 0,0 of the DIAGRAM instead.

The coordinates should be 
printedtable.x = layer.x + tableinlayer.x
printedtable.y = layer.y + tableinlayer.y

Hope this additional information is useful.
[12 Jan 2010 7:20] Valeriy Kravchuk
Thank you for the bug report. Verified just as described on 64-bit XP.
[22 Jan 2010 2:28] Alfredo Kojima
This is a problem specific to Windows, the same model prints fine in Mac and Linux.
We're investigating.
[22 Jan 2010 2:29] Alfredo Kojima
duplicate of bug #47384