Book a Demo

Author Topic: CENTER origin in shape script inconsistent  (Read 7568 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
CENTER origin in shape script inconsistent
« on: August 29, 2008, 01:14:02 pm »
shape main
{
    setlinestyle("solid");
    setorigin("CENTRE",0,0);
    arc(10,10,-10,-10,0,0,0,0);
}

Watch the preview window.

Observe how the other values move the circle (which displays as an elipse YET ANOTHER BUG!), for all the values other than CENTER moves as expected.  CENTER behaves quite differently.

If the intent is to have a position outside rest, then it should have a special name NOT center.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #1 on: August 29, 2008, 01:45:34 pm »
I thought I saw something a while ago...

IIRC SetOrigin seems to have been merged into one of the other functions, in that SetOrigin has become obsolete and is just there for legacy reasons (or something). I gather the two functions were not originally identical. I gather that the SetOrigin function now does something slightly different than it was originally (no pun) intended for. [I don't know how well that intent was expressed outside of Sparx.]

I also remember seeing something to the effect that the name given to the SetOrigin function was a poor choice in retrospect. [But you already know that.]

David
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #2 on: August 29, 2008, 01:52:36 pm »
It does appear to be wrong for "CENTER", "E" and "W".  Please report a bug using the appropriate form and I'll see that someone looks at it.

Regarding the ellipse instead of circle.  That's because the coordinate system is relative to the size of the object.  If the object isn't square, the coordinate system won't be either.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #3 on: August 29, 2008, 02:02:18 pm »
Quote
It does appear to be wrong for "CENTER", "E" and "W".  Please report a bug using the appropriate form and I'll see that someone looks at it.

Regarding the ellipse instead of circle.  That's because the coordinate system is relative to the size of the object.  If the object isn't square, the coordinate system won't be either.
Bug report sent...

Regarding ellipse... Yes, on the diagram that would/might be appropriate.  There should be an option to scale/not scale with the object.

However, with the preview, in my view (pun intended!), there is NO excuse...  If I say draw a circle, I expect to see a circle NOT an ellipse...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #4 on: August 29, 2008, 03:21:57 pm »
Quote
However, with the preview, in my view (pun intended!), there is NO excuse...  If I say draw a circle, I expect to see a circle NOT an ellipse...
The obvious solution would be a square preview area. Should be easy to implement...
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #5 on: August 29, 2008, 09:01:21 pm »
And to render only that portion of the (square) preview area that would be used by the shape as scripted.
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #6 on: August 29, 2008, 09:02:16 pm »
And the ability to iterate through (or otherwise choose) which shape (or subset of shapes) will be rendered in the preview.
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #7 on: September 01, 2008, 08:24:46 am »
Quote
However, with the preview, in my view (pun intended!), there is NO excuse...  If I say draw a circle, I expect to see a circle NOT an ellipse...
As I often do, I'm going to disagree on that.  If the preview window is about showing you what you'll see on a diagram, a square preview is likely to give the wrong impression of what is going to be drawn.

Quote
And the ability to iterate through (or otherwise choose) which shape (or subset of shapes) will be rendered in the preview.
You mean like the 'Next Shape' button?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #8 on: September 01, 2008, 10:20:05 am »
Sort of, but a little more than that. It would be good to preview the relationship between the various shapes that make up a script.
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #9 on: September 01, 2008, 11:31:34 am »
Quote
Quote
However, with the preview, in my view (pun intended!), there is NO excuse...  If I say draw a circle, I expect to see a circle NOT an ellipse...
As I often do, I'm going to disagree on that.  If the preview window is about showing you what you'll see on a diagram, a square preview is likely to give the wrong impression of what is going to be drawn.
You're welcome (and encouraged) to disagree!  But, come on Simon!  What gets drawn on the diagram depends on the current scaling of the current item under view.  The preview distortion is caused by the fact (as Neil said) that the preview areas is NOT square (as it  should be).  There is NO a priori correlation between the aspect ratio of the preview area and that of any specific shape of that stereotype on any drawing.  

Consequently, the user has to observe any shape in the actual diagrams and make a decision as to how to obtain the best results overall.  This process would be immensly helped by the preview area showing a correct rendering (at the 1:1 aspect ratio) rather than a distorted one at some unknown aspect ratio.

That's no different from any other drawing package.  What's different (as usual) is EAUI!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #10 on: September 01, 2008, 12:10:22 pm »
But you've completely missed my point.

You originally said it was a bug that it drew as an ellipse.  If the preview window had of been square, you would have thought that EA's rendering was wrong because it was different from the preview window.  At least the preview window accurately represents that the objects that get drawn have an unknown aspect ratio.

Now, it would be nice to allow resizing of the preview... But given all the other things that can be done I wouldn't.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #11 on: September 01, 2008, 03:05:29 pm »
Quote
But you've completely missed my point.

You originally said it was a bug that it drew as an ellipse.  If the preview window had of been square, you would have thought that EA's rendering was wrong because it was different from the preview window.  At least the preview window accurately represents that the objects that get drawn have an unknown aspect ratio.

Now, it would be nice to allow resizing of the preview... But given all the other things that can be done I wouldn't.
With respect, I think you've missed my point...

Since you don't know the aspect ratio of the preview window, how can you draw anything with any certainty?  All you need is to set the window up "square" and have a label saying: shapes in the diagram may be affected by the items aspect ratio.  Don't forget, I can (as you thoughtfully indicated) I can set scalable=false.  So if I draw a circle I should get a circle...

Or are you implicitly telling me that the size of the preview window is automatically adjusted to the aspect ratio of the selected item?

If so, which aspect ratio is picked when there is no item selected?

By making the preview window accurate, I can stand a better chance of figuring out if the problem with my shape is because I haven't drawn it correctly or I've just hit another EA bug.  Because, "by design", what I write is NOT what is drawn, I'm already behind the "eight ball".

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: CENTER origin in shape script inconsistent
« Reply #12 on: September 01, 2008, 09:32:25 pm »
And this makes my point - once again, thanks Paolo - more clear as well. I get only limited benefit from looking at a full-sized shape when I need to see how and where a decoration will be rendered. It would be even better if I could concentrate on getting the decoration working, then have to option to see it with the final shape. There's a lot that could be done with the preview window, to improve the user experience.

David
No, you can't have it!