Book a Demo

Author Topic: Removing default glyph boundary  (Read 3846 times)

sladep

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Removing default glyph boundary
« on: February 26, 2009, 12:10:16 pm »
Hi,

I am using image scripting associated with custom stereotypes. I have drawn one image using the lineoto commands. However, the total area of the image is 25 x 20, but the underlying glyph size dominates the diagram.  My question is how do I change the default glyph size so that the area occupied is the same as the image?

Slade

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Removing default glyph boundary
« Reply #1 on: February 26, 2009, 01:01:31 pm »
It's hard to know for certain without seeing your shape script, but it sounds like a "pixel count vs percentage" confusion. With shape script functions such as moveto(), lineto(), rectangle() and ellipse(), their parameters all represent a percentage of the overall size. If you want a rectangle that is 25x20 pixels, it is tempting to use the command rectangle(0,0,25,20); but that would be wrong. First define the area as 25x20 and then use 100% of it, as follows:

shape main
{
    defsize(25,20);
    rectangle(0,0,100,100);
}

I hope this helps. If not, please post your shape script to this thread and we can see what is going wrong.
The Sparx Team
[email protected]

sladep

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Removing default glyph boundary
« Reply #2 on: February 26, 2009, 02:09:40 pm »
Tried that but it didn't work. Script follows:

shape main
{
noshadow="true";
scalable="false";
setfillcolor(0,0,255);
defsize(20,20);
startpath();
moveto(10,0);
lineto(20,20);
lineto(0,20);
lineto(10,0);
endpath();
fillandstrokepath();
}

Help!

sladep

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Removing default glyph boundary
« Reply #3 on: February 26, 2009, 02:13:44 pm »
Don't know what changed, but that is working now... Thanks