|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Symbolic Notations - Geometry operator @ - bug?Hello List,
I read the Symbolic Notations help file and I liked the way to describe a Rect() by making 2 Points with ( x @ y ) "shortcut" I'm having a little trouble with it know, you see, I have this 2 lines and they should give the same result: Window( "a Window @@@", (500 @ 500) @ (640 @ 480) ).front; Window( "a Window Rect()", Rect(500, 500, 640, 480) ).front; When I check just this: (500 @ 500) @ (640 @ 480) It returns Rect(500, 480, 140, 20) Which is tottally different than expected. But executing each Point separated gives the right result... i.e. this two lines: (500 @ 500) (640 @ 480) gives me: Point( 500, 500 ) Point( 640, 480 ) Which is ok. But yet again this: Point( 500, 500 ) @ Point( 640, 480 ) will return Rect(500, 480, 140, 20) false again.... Is this a kind of bug? If it's only me who's having this trouble? I can send screenshots if needed. I'm using RC3, but tested it on RC1 and even 3.2 with the same results. Ah yeah... and I'm on an intel machine with leo. Thanks in advance |
|
|
Re: Symbolic Notations - Geometry operator @ - bug?No, not a bug. The printout from Rect displays, in order, left, top, width, height. When you make a Rect from two Points, the specification is (x1, y1) @ (x2, y2) where x1 and x2 represent left and right (or vice versa), and y1 and y2 are the top and bottom coordinates. The Rect should show (min(x1, x2), min(y1, y2), abs(x1 - x2), abs(y1 - y2)) ... which is exactly what you see. In other words, it looks like you expect the second Point to be the width and height, but they are the real coordinates. hjh On Apr 25, 2009, at 10:17 PM, Juan Gabriel Alzate Romero wrote: Hello List, : H. James Harkins .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |
|
|
Re: Symbolic Notations - Geometry operator @ - bug?hey juan,
you can simply do var corner = (100 @ 200); var width = (300@400); corner @ (corner + width); // Rect(100, 200, 300, 400) best, adc >No, not a bug. The printout from Rect displays, in order, left, top, >width, height. When you make a Rect from two Points, the >specification is (x1, y1) @ (x2, y2) where x1 and x2 represent left >and right (or vice versa), and y1 and y2 are the top and bottom >coordinates. The Rect should show > >(min(x1, x2), min(y1, y2), abs(x1 - x2), abs(y1 - y2)) > >... which is exactly what you see. > >In other words, it looks like you expect the second Point to be the >width and height, but they are the real coordinates. >hjh > >On Apr 25, 2009, at 10:17 PM, Juan Gabriel Alzate Romero wrote: > >>Hello List, >> >>I read the Symbolic Notations help file and I liked the way to >>describe a Rect() by making 2 Points with ( x @ y ) "shortcut" >>I'm having a little trouble with it know, you see, I have this 2 >>lines and they should give the same result: >> >>Window( "a Window @@@", (500 @ 500) @ (640 @ 480) ).front; >>Window( "a Window Rect()", Rect(500, 500, 640, 480) ).front; >> >>When I check just this: >> >>(500 @ 500) @ (640 @ 480) >> >>It returns >> >>Rect(500, 480, 140, 20) >> >>Which is tottally different than expected. But executing each >>Point separated gives the right result... i.e. this two lines: >> >>(500 @ 500) >>(640 @ 480) >> >>gives me: >> >>Point( 500, 500 ) >>Point( 640, 480 ) >> >>Which is ok. But yet again this: >> >>Point( 500, 500 ) @ Point( 640, 480 ) >> >>will return >> >>Rect(500, 480, 140, 20) >> >>false again.... Is this a kind of bug? If it's only me who's >>having this trouble? I can send screenshots if needed. >>I'm using RC3, but tested it on RC1 and even 3.2 with the same results. >>Ah yeah... and I'm on an intel machine with leo. >> >>Thanks in advance >> > > >: H. James Harkins >: <mailto:jamshark70@...>jamshark70@... >: <http://www.dewdrop-world.net>http://www.dewdrop-world.net >.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: > >"Come said the Muse, >Sing me a song no poet has yet chanted, >Sing me the universal." -- Whitman -- -- Alberto de Campo Bergstrasse 59/33 A-8020 Graz, Austria e-mail : adc@... -- _______________________________________________ sc-users mailing list info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml archive: http://www.listarc.bham.ac.uk/marchives/sc-users/ search: http://www.listarc.bham.ac.uk/lists/sc-users/search/ |
|
|
Re: Symbolic Notations - Geometry operator @ - bug?Hey! Thanks James & Alberto (nice hearing from you again :-) btw)
ok, I'm sorry that stupid question. I've used this almos always with (0@0) @ (w@h) and looked ok, but ofcourse, beacuse of the first coordinates... so I thought it was like building a Rect. Well, sorry again, my error, and thanks Alberto for the "corner @ (corner + width)". :-) bye -juan On 26.04.2009, at 10:28, Alberto de Campo wrote: > hey juan, > > you can simply do > > var corner = (100 @ 200); > var width = (300@400); > corner @ (corner + width); // Rect(100, 200, 300, 400) > > best, adc > > >> No, not a bug. The printout from Rect displays, in order, left, >> top, width, height. When you make a Rect from two Points, the >> specification is (x1, y1) @ (x2, y2) where x1 and x2 represent left >> and right (or vice versa), and y1 and y2 are the top and bottom >> coordinates. The Rect should show >> >> (min(x1, x2), min(y1, y2), abs(x1 - x2), abs(y1 - y2)) >> >> ... which is exactly what you see. >> >> In other words, it looks like you expect the second Point to be the >> width and height, but they are the real coordinates. >> hjh >> >> On Apr 25, 2009, at 10:17 PM, Juan Gabriel Alzate Romero wrote: >> >>> Hello List, >>> >>> I read the Symbolic Notations help file and I liked the way to >>> describe a Rect() by making 2 Points with ( x @ y ) "shortcut" >>> I'm having a little trouble with it know, you see, I have this 2 >>> lines and they should give the same result: >>> >>> Window( "a Window @@@", (500 @ 500) @ (640 @ 480) ).front; >>> Window( "a Window Rect()", Rect(500, 500, 640, 480) ).front; >>> >>> When I check just this: >>> >>> (500 @ 500) @ (640 @ 480) >>> >>> It returns >>> >>> Rect(500, 480, 140, 20) >>> >>> Which is tottally different than expected. But executing each >>> Point separated gives the right result... i.e. this two lines: >>> >>> (500 @ 500) >>> (640 @ 480) >>> >>> gives me: >>> >>> Point( 500, 500 ) >>> Point( 640, 480 ) >>> >>> Which is ok. But yet again this: >>> >>> Point( 500, 500 ) @ Point( 640, 480 ) >>> >>> will return >>> >>> Rect(500, 480, 140, 20) >>> >>> false again.... Is this a kind of bug? If it's only me who's >>> having this trouble? I can send screenshots if needed. >>> I'm using RC3, but tested it on RC1 and even 3.2 with the same >>> results. >>> Ah yeah... and I'm on an intel machine with leo. >>> >>> Thanks in advance >>> >> >> >> : H. James Harkins >> : <mailto:jamshark70@...>jamshark70@... >> : <http://www.dewdrop-world.net>http://www.dewdrop-world.net >> .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: >> >> "Come said the Muse, >> Sing me a song no poet has yet chanted, >> Sing me the universal." -- Whitman > > > -- > -- > Alberto de Campo > Bergstrasse 59/33 > A-8020 Graz, Austria > e-mail : adc@... > -- > > _______________________________________________ > sc-users mailing list > > info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml > archive: http://www.listarc.bham.ac.uk/marchives/sc-users/ > search: http://www.listarc.bham.ac.uk/lists/sc-users/search/ _______________________________________________ sc-users mailing list info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml archive: http://www.listarc.bham.ac.uk/marchives/sc-users/ search: http://www.listarc.bham.ac.uk/lists/sc-users/search/ |
| Free embeddable forum powered by Nabble | Forum Help |