Book a Demo

Author Topic: Shape script image squashed in Info View, can a script detect Info View?  (Read 86 times)

elr

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Hello all,

In EA 17.1, I maintain an MDG Technology in which about 100 stereotypes extend Class. Each draws an Azure service icon, a square PNG stored in the technology's images, with the name underneath. All of them use the same shape script:

Code: [Select]
shape main
{
    layouttype="border";
    noshadow=true;
    fixedaspectratio=true;
    defsize(79,90);
    image("Azure_Firewall",10,0,90,70);
    addsubshape("S","S");
    shape S
    {
        preferredheight=26;
        v_align="top";
        h_align="center";
        printwrapped("#name#");
    }
}

In the normal view, the icon keeps its aspect ratio.

When Info View is enabled on the element, EA draws the same script as a small icon at the top right of the info box. That icon is squashed horizontally: the square firewall image comes out at about 39 x 20 px. EA seems to render shape main in a frame that is roughly twice as wide as it is high, and to ignore fixedaspectratio there.

What I tried
  • Branching on rectangle notation:
Code: [Select]
if(hasproperty("rectanglenotation","1")) { image(...,25,0,75,100); }
else { image(...,10,0,90,70); ... }
    This fixes Info View, but the normal view also takes the first branch, so the icon is stretched vertically and the name disappears. Both views appear to return the same value.[/li]

  • A separate shape icon { ... } section: EA ignores it in Info View.
  • Comparing diagram objects: in t_diagramobjects.ObjectStyle, the only difference is that the Info View objects lack UCRect=1. I found no shape-script property that exposes this.

Questions
  • Is there a property or query method that tells a shape script it is being drawn as the Info View icon, such as a hasproperty(...) value?
  • Alternatively, is there a supported way to give a stereotype a separate icon for Info View, or to make EA keep the aspect ratio of image() in that frame?

Thanks in advance.

Eric