Book a Demo

Author Topic: Shape script - shape within a shape  (Read 3264 times)

GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Shape script - shape within a shape
« on: June 23, 2020, 05:49:12 pm »
Hi
I want to draw a parallelogram and have it fully enclosed within rectangle.
I have managed to get the parallelogram in a rectangle but the rectangle is always taller than the parallelogram.

How can I make them the same height?
shape main
{
   noShadow=true;
   fixedAspectRatio = "true";
   scalable="true";

   DefSize(100,70);
   StartPath();
   Rectangle(0,0,100,100);
   EndPath();
   StrokePath();

   startpath();
   moveto(10,0);
   lineto(100,0);
   lineto(90,70);
   lineto(0,70);
   lineto(10,0);
   endpath();
   fillandstrokepath();
}



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shape script - shape within a shape
« Reply #1 on: June 23, 2020, 06:42:30 pm »
You are not going lower than 70 with your parallelogram.
make it go to 100 on the Y axis

Geert

GrahamL

  • EA User
  • **
  • Posts: 111
  • Karma: +2/-0
    • View Profile
Re: Shape script - shape within a shape
« Reply #2 on: June 23, 2020, 06:43:57 pm »
Yes just spotted that

Thanks for all your help ;D