Book a Demo

Author Topic: How do I control sizing handles for new shape?  (Read 2550 times)

Buzzer

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
How do I control sizing handles for new shape?
« on: December 01, 2010, 12:49:18 am »
Hi
I created a new stereotype and assigned a new shape script for it, but when I create an element, the sizing rectangle is larger than the overall size of the shape. Can I control this ?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How do I control sizing handles for new shape?
« Reply #1 on: December 01, 2010, 08:36:18 am »
Change your shape script to take up the full space.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How do I control sizing handles for new shape?
« Reply #2 on: December 01, 2010, 10:21:53 am »
Buzzer,

In case Simon's reply is too cryptic, be aware that values passed to drawing commands in shape scripts (e.g. rectangle(), moveto(), lineto()) are percentage of the overall shape. So to create a 50x50 square, the following is wrong:
Code: [Select]
shape main
{
    rectangle(0,0,50,50);
}
Instead, you would need:
Code: [Select]
shape main
{
    defsize(50,50);
    rectangle(0,0,100,100);
}
The Sparx Team
[email protected]

Buzzer

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: How do I control sizing handles for new shape?
« Reply #3 on: December 01, 2010, 07:49:39 pm »
Thanks guys. It worked perfectly.