archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
954 stars 268 forks source link

Icon figure style doesn't respond to text position if element has no name or label #895

Closed jbsarrodie closed 1 year ago

jbsarrodie commented 1 year ago

In issue #772 we adjusted the way an icon figure respond to text alignment and position so that the icon is "pushed" by the name or label of the element.

But when working on this topic, I never tried with an empty name/label. I've just tried it and discovered something which IMHO is a bug.

in the following example, both Business Actors have the exact same configuration for text alignment and position, the only difference being the name (which is empty for the second one): image

I have the feeling that the current behavior is wrong and that the icon should always be located at the same place whatever the name/label (in this case, pushed on the left). My motivation for that is that (for example) it might make sense to start creating a view using icons with name, but later decide that some names should be hidden to make the view easier to understand for some stakeholder. Of course we might have som users

So basically, an easy fix for this would be to remove the first condition (non empty text) in AbstractTextControlContainerFigure#setFigurePositionFromTextPosition().

Of course changing this behavior can impact some already existing views if text alignment is different that centered and name and labels are not set, but I think this is an edge case (after all it took me 1 year to discover it) and Archi 5 is the right moment to introduce such change.

@Phillipus : Some of my current changes depends on whether or not we accept this change. Are you ok with me doing such change?

Phillipus commented 1 year ago

Sure, why not? Put it all in a branch and we can test it. :-)

Phillipus commented 1 year ago

@jbsarrodie Hi, any progress on this one? :-)

jbsarrodie commented 1 year ago

@jbsarrodie Hi, any progress on this one? :-)

Hi, yes, I applied a (really simple) patch. I'm still working on some figures (but it was hard to find enough time to finish pas weeks).

Phillipus commented 1 year ago

Merged to master, thank-you. :-)