[Gambas-user] Is it a bug or a "feature"?

Benoît Minisini gambas at ...1...
Mon Sep 14 20:59:06 CEST 2009


> On Sunday 13 September 2009 19:16:34 Benoît Minisini wrote:
> > > Hi Gambas users.
> > > I have found that in version 2.16 Draw.Ellipse does not
> > > work as it was in 2.7 (my previous version).
> > > In 2.16 the parameters which should specify coordinates of the
> > > Ellipse centre are actually corresponding to  the upper left corner
> > > of the rectangular area where ellipse is placed.
> > > I think it must be a bug.
> > > Aleks
> >
> > I think you have dreamt that: an ellipse has no center. It has two
> > focuses.
> >
> > Regards,
> 
> I would prefer not to give lectures in mathematics in this forum.
> I have another place to do that. However I must draw your attention
> to the fact that exactly between  2 focuses is a center.A center of gravity
>  if you remember some physics or a center of inversion if you prefer
> symmetry. consideration.
> 

Sorry, my joke didn't work! :-/

I meant that AFAIK, Draw.Ellipse() didn't change at all since the beginning. 
It always took the coordinates of the rectangle surrounding it.

> The problem however is that the figure is placed in a wrong place in a
>  drawing area. To see it you can draw an ellipse in a center of a square
>  Drawing Area and
> you will see that it is displaced in positive direction in both X an Y.
> To do things simple enough for not a professional in maths make both axes
> of an ellipse equal and get a circle. I hope it will convince you.
> 

I don't understand what you want to do exactly: if you want to draw an ellipse 
from is center and its two diameters (for example), assuming that the two 
ellipse axes are horizontal and vertical, you can do:

Draw.Ellipse(XCenter - XDiameter / 2, YCenter - YDiameter / 2, XDiameter, 
YDiameter)

Of course, you will lost one pixel if XDiameter or YDiameter is not even. 

And if you want to rotate the ellipse, you will have to draw it yourself!

Regards,

-- 
Benoît Minisini




More information about the User mailing list