| Summary: | Export wide Diagram in image using png format produced truncated diagram. | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Jessy Mallet <jessy.mallet> | ||||||||||
| Component: | Diagram | Assignee: | Pierre-Charles David <pierre-charles.david> | ||||||||||
| Status: | CLOSED FIXED | QA Contact: | Julien Dupont <julien.dupont> | ||||||||||
| Severity: | major | ||||||||||||
| Priority: | P3 | CC: | cedric.brun, julien.dupont, pierre-charles.david | ||||||||||
| Version: | unspecified | Keywords: | triaged | ||||||||||
| Target Milestone: | 5.0.0 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows NT | ||||||||||||
| See Also: |
https://git.eclipse.org/r/98540 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=9261d08efd5a8090ad7f6959fb5b90d3c21c7cc1 |
||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 268621 [details]
Export diagram KO
Created attachment 268622 [details]
Export diagram OK
This seems caused by the changes made for https://bugs.eclipse.org/bugs/show_bug.cgi?id=507056: * on current master (Sirius 5.0.0rc2), I reproduce the issue (under Linux). * with the patches made for #507056 reverted, the bug is no longer there. I'll look into it. @cedric I'm adding you in CC in case I have specific questions about your code. Bug #507056 had 3 commits. After reverting the whole set (back to a working state), and re-applying them one by one: * 71b84800013644898560aa649ccd8e0d55afd86c: introduces the regression. * A small diagram is exported (in PNG only) with quite a lot of unneeded whitespace to the right and bottom: a 12156×4106 pixels PNG, where only the top-left ~1200×400 are used for the diagram. * A large diagram gets exported (in PNG) with all the parts visible, and a little bit of unneeded whitespace. 7409×6626 pixels, where "only" ~6900×5250 are occupied. At least in this state the whole diagram is visible. * 069b6e20e89226709b111fbda0046f07dfc1ceca: does not change anything * fd45868c116805919c041bdc2e099cdc9b3fde35: * The small diagram is exported to a smaller PNG (3483×1176), but sill exhibits the unneeded whitespace issue: only ~1200×400 are occupied. * The large diagram is exported to a 2166×1902 PNG, but this time the bottom-right part of the diagram is lost. From this data (at least in the case of the small diagram), it seems the scaling factor used to determine the physical size of the PNG canvas is not passed to the underlying rendering code, which renders it at the "native" scaling factor. I have a simple fix for the first issue visible on small diagrams, which is actually different from the one reported. No luck yet on the second one. New Gerrit change created: https://git.eclipse.org/r/98540 Created attachment 268768 [details] Exported diagrams on master (with the bug) vs with the patch It looks like the patch at https://git.eclipse.org/r/#/c/98540/1 fixes all the issues. Attached is a comparison of 2 exported diagrams (one small, one large) with all supported images formats, on master (5324a88e840fc4fb548b076f89a61a331b7e4141) and with the patch. Gerrit change https://git.eclipse.org/r/98540 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=9261d08efd5a8090ad7f6959fb5b90d3c21c7cc1 Fixed by 9261d08efd5a8090ad7f6959fb5b90d3c21c7cc1.. Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details. |
Created attachment 268620 [details] Test case to reproduce bug. When user export diagram as image with png format, the diagram exported is truncated (see diag-5815-5575.png). With other format (jpg/gif/bmp/svg), the diagram is well exported without problem (see diag-5815-5575.jpg). Steps to reproduce : * Import project Compartiments (from exportDiagramCut.zip) * Open diagram "diag-5815-5575" * export this diagram as image with jpg format : the diagram is fully exported -> OK * export this diagram as image with png format : the diagram is truncated -> KO