Closed vrichard12 closed 11 months ago
Here is a download link for the M2DocEmptyDiagram project.
I think you could do this if we implement the fit() service from this issue #473.
Thank you Yvan, I think this is the best you can do from the M2Doc point of view. Generating a small image for empty diagrams should be seen with the Sirius team.
I close this issue as the #473 is fixed.
I'm submitting a...
Current behavior
When generating a document for a template inserting representation images with the service
EObject.asImageByRepresentationDescriptionName(String)
, the generated images are way too big. M2Doc generates a 829x4974 image when the"Size of exported images" preference is set to maximum and a 20x120 image when the preference is set to minimum. Changing this preference doesn't constitute a workaround as usually the call toasImageByRepresentationDescriptionName
is followed by something like.setConserveRatio(true).setWidth(450)
. The formatting of the resulting document is then very odd because a place bigger than a page is taken by this empty image. The vertical shape of the image doesn't help either using thesetWidth
service. This service makes sense when the image is not empty, but if it is then applying a.setConserveRatio(true).setWidth(450)
makes a vertical image of 2700 pixels!Expected behavior
Empty representations should be exported as very small and horizontal images, or if that is possible exported as nothing.
Minimal reproduction of the problem with instructions
Please see the attached
M2DocEmptyDiagram
M2Doc modeling project.What is the motivation / use case for changing the behavior?
Testing that a representation is empty is possible with this query :
representation.oclAsType(diagram::DSemanticDiagram).ownedDiagramElements->notEmpty()
but it complexifies the writing of the templates. (By the way, for this query to work the following nsuris have to be added to the template properties: http://www.eclipse.org/sirius/1.1.0 and http://www.eclipse.org/sirius/diagram/1.1.0). The need is to make the writing of templates as simple as possible.Environment