Bug 432260 - [Symbol] Name should be centered/inside PapyrusLabel path of SVG shapes
Summary: [Symbol] Name should be centered/inside PapyrusLabel path of SVG shapes
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-08 05:44 EDT by Toni Siljamäki CLA
Modified: 2017-09-08 09:45 EDT (History)
5 users (show)

See Also:


Attachments
Screenshot showing name not always centered (20.35 KB, image/jpeg)
2014-04-08 05:44 EDT, Toni Siljamäki CLA
no flags Details
SVG shape with PapyrusLabel path (5.27 KB, image/svg+xml)
2014-04-08 05:44 EDT, Toni Siljamäki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Siljamäki CLA 2014-04-08 05:44:09 EDT
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.
Comment 1 Toni Siljamäki CLA 2014-04-08 05:44:54 EDT
Created attachment 241714 [details]
SVG shape with PapyrusLabel path
Comment 2 Camille Letavernier CLA 2015-02-25 04:47:12 EST
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
Comment 3 Toni Siljamäki CLA 2015-03-05 05:48:27 EST
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.
Comment 4 Camille Letavernier CLA 2015-03-05 07:25:34 EST
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?
Comment 5 Toni Siljamäki CLA 2015-03-06 05:10:40 EST
My thinking is that it perhaps is related to the problem in Bug 431041
Maybe it's a simple rounding-off error ?