Community
Participate
Working Groups
Created attachment 241713 [details] Screenshot showing name not always centered Attached is a screenshot showing NWA Surfboards / SVG shapes where the name of the component sometimes is not centered inside the PapyrusLabel path of the SVG shape. Sometimes the name is displayed outside the boundaries of the PapyrusLabel, even when there is "plenty" of room for the name inside the label. When there is room for the entire name inside the PapyrusLabel the name should be centered inside the name label. I hope it has a simple solution that can be fixed quickly.
Created attachment 241714 [details] SVG shape with PapyrusLabel path
The new customizations in Papyrus Mars allow you to specify a floating label for any element using CSS directly (Rather than SVG). This may be more flexible than the current PapyrusLabel option, and I think there are options to specify the position and alignment of the label. Also, the label may be bigger than the shape containing it, which AFAIK wasn't possible with SVG (The label was part of the image) So I'd recommend using the new floating label instead Bug 436547: [Diagram] All shapes shall be refactored https://wiki.eclipse.org/Papyrus/Mars_Work_Description/NewFeature/Shape_customisation https://wiki.eclipse.org/Papyrus/Mars_Work_Description/NewFeature/Shape_customisation#Floating_Label I haven't verified whether this completely solves that issue, or if alignment options for the floating label needs to be improved further
Switching to floating labels at this point is really not an option, since it would affect all existing diagrams. The usability of floating labels needs some investigations.
The position of the label is defined in the SVG. It seems that Papyrus already centers the text inside the Label rectangle. So if the Label Rectangle is center (Or takes all the available width inside the image), it should be OK. For example, the Papyrus AcceptEventAction in Mars is defined like that: it uses the PapyrusLabel, and the text is properly centered inside (Well, more or less, because the rectangle is not perfectly centered inside the SVG image). The SVG image you attached seems OK (I cannot reproduce the centering issue), but it doesn't correspond to the images in your screenshot. Maybe the SVG in your screenshot don't properly center the PapyrusLabel area?
My thinking is that it perhaps is related to the problem in Bug 431041 Maybe it's a simple rounding-off error ?