What is the point???
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
What is the point???
I made a simple test stack to show how one can snap a particular point of one control, like its corner, to another "point" of interest, like a corner or the midpoint of a side, on another control. Works fine, though I do not expect to be able to create another SolidWorks out of LC.
But there is something amiss, and it has to do with my LC understanding of the bounds of a control. In the stack, with the optionKey down, one may drag the small field around the card, and if its botLeft gets near the topRight of the larger field, it will snap to that point.
But release the optionKey to leave the small field in place, and there is a gap visible between the two controls at what should be their shared point. The topRight of the larger field is the same as the botLeft of the smaller, but they do not visually coincide.
What is the point?
There is a similar handler in the small field script that allows one to set the botLeft of the small field to the midpoint of the right side of the larger. Same issue there.
Craig
But there is something amiss, and it has to do with my LC understanding of the bounds of a control. In the stack, with the optionKey down, one may drag the small field around the card, and if its botLeft gets near the topRight of the larger field, it will snap to that point.
But release the optionKey to leave the small field in place, and there is a gap visible between the two controls at what should be their shared point. The topRight of the larger field is the same as the botLeft of the smaller, but they do not visually coincide.
What is the point?
There is a similar handler in the small field script that allows one to set the botLeft of the small field to the midpoint of the right side of the larger. Same issue there.
Craig
Last edited by dunbarx on Wed Jun 12, 2024 3:23 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: What is the point???
I didn't look at your stack, but made my own.
- -
The Bottom Right of the field is 150, 90
The Top Left of the button is 150, 90
And, Yes: there is an extremely visible gap between them.
LC Community 9.6.3

- -
The Bottom Right of the field is 150, 90
The Top Left of the button is 150, 90
And, Yes: there is an extremely visible gap between them.
LC Community 9.6.3
Re: What is the point???
Richmond.
I am wondering if this is some sort of optical illusion, based on the fact that a screen can only do so much to render and locate objects on itself accurately.
With a loupe on my monitor I see many more pixels, about twice the pixel density, than what typically is the resolution of "one pixel" that we are used to when manipulating objects with the several programs we all use every day. Maybe this is all a rounding error?
Craig
I am wondering if this is some sort of optical illusion, based on the fact that a screen can only do so much to render and locate objects on itself accurately.
With a loupe on my monitor I see many more pixels, about twice the pixel density, than what typically is the resolution of "one pixel" that we are used to when manipulating objects with the several programs we all use every day. Maybe this is all a rounding error?
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: What is the point???
Here's another silly picture:
- -
What I notice is that the selection handles are "fatter' on the outside of an object than inside.
So this tells me that those points are "off".
- -
What I notice is that the selection handles are "fatter' on the outside of an object than inside.
So this tells me that those points are "off".
Re: What is the point???
Richmond.
The selection handles are not considered any part of the geometry of the objects, rather only temporary aids. Only the rect of an object matters.
Craig
The selection handles are not considered any part of the geometry of the objects, rather only temporary aids. Only the rect of an object matters.
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: What is the point???
You'd have thought so, wouldn't you.Only the rect of an object matters.
But there is something a bit odd when the same set of points result in 2 things being separated by an empty patch.
- -
There's no gap between his 2 front teeth: honest!

Re: What is the point???
Richmond.
A "point" is not a mathematical point, but rather a blotch. It has a length and width, based on the measurable pixels that form the display. So where do we "locate" the, er, loc of such a smear?
At the center? Likely it is instead at the "outer" extreme. In CAD programs that have adjustable line widths, the outermost portion of a line sets the value of its thickness. I am sure LC does the same.
So again, Is there really a gap, or is it an illusion caused by the screen doing its best with not-infinitely-small pixels?
Craig
A "point" is not a mathematical point, but rather a blotch. It has a length and width, based on the measurable pixels that form the display. So where do we "locate" the, er, loc of such a smear?
At the center? Likely it is instead at the "outer" extreme. In CAD programs that have adjustable line widths, the outermost portion of a line sets the value of its thickness. I am sure LC does the same.
So again, Is there really a gap, or is it an illusion caused by the screen doing its best with not-infinitely-small pixels?
Craig
Re: What is the point???
Richmond.
Terry-Thomas looks SO British; the gap only helps. Even the dash in his name screams that out.
Craig
Terry-Thomas looks SO British; the gap only helps. Even the dash in his name screams that out.
Craig
Re: What is the point???
Maybe it's just an optical effect. Because if you change the background color of the fields and set the showBorder property to false. It is seen that they are indeed where they should be.
- Attachments
-
- Screenshot_6.png (5.36 KiB) Viewed 3643 times
-
- Screenshot_5.png (4.68 KiB) Viewed 3643 times
Be kind, we all have our own wars.
https://torocruzand.com/
https://torocruzand.com/
Re: What is the point???
Andresdt.
AHA.
So it is just screen rendering doing its best in a clunky world.
Craig
AHA.
So it is just screen rendering doing its best in a clunky world.
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: What is the point???
Indeed: ROFL.a clunky world
Just upgraded my 2018 Mac Mini to MacOS 15 Sequoia . . .
Re: What is the point???
I suspect it’s because borderwith of either object has not been taken into account…
Re: What is the point???
Stam.
If I read your post correctly, that would cause the two objects to appear to overlap, not (appear to) fail to meet, no?
Craig
If I read your post correctly, that would cause the two objects to appear to overlap, not (appear to) fail to meet, no?
Craig
Re: What is the point???
Yeah that's right. I mean, they either overlap on 1 dot, or there is a gap, which if I understood correctly, is what you were trying to solve.
this modification to your code seems to make it work well, but is not generalisable (ie assumes we're only talking about the bottomLeft->topRight and that the borderWidth of both objects is 1)
This makes it look like this:
this modification to your code seems to make it work well, but is not generalisable (ie assumes we're only talking about the bottomLeft->topRight and that the borderWidth of both objects is 1)
Code: Select all
on mousemove --to the corner
if the optionKey is down then set the loc of me to the mouseLoc
if abs(item 1 of the botLeft of fld "F1" - item 1 of the topRight of fld "F2") < 8 and \
abs(item 2 of the botLeft of fld "F1" - item 2 of the topRight of fld "F2") < 8 then \
set the botleft of fld 1 to right of fld "f2" - 1, the top of fld "f2" + 1
end mousemove
Re: What is the point???
I think this has somehow to do with the cartesian coordinates that start at 0,0. TopLeft is within the rect, botRight is outside.
Kind regards
Bernd
Code: Select all
on mouseUp
put the rect of field 1 into tRect
put item 1 of tRect, item 2 of tRect into tTopLeft
put item 3 of tRect, item 4 of tRect into tBotRight
put "topLeft is within: " & (tTopLeft is within tRect) & cr & "botRight is within: " & (tBotRight is within tRect)
end mouseUp
Bernd