math on widths doesn't add up

Dar Scott Consulting dsc at swcp.com
Fri Jun 14 16:21:26 EDT 2019


I like this interpretation. I don't think it is a popular view, but it makes sense to me.

I would change the range wording, though, to something like this:
Pixel 0 ranges from 0 to 1.

For example, the rect of a card has zeros.

Maybe it depends on whether one wants to draw pixels on the intersections of the lines on the graph paper, or in between.


> On Jun 14, 2019, at 1:55 PM, hh via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Nothing is wrong:
> If you have a row then left is the integer left of first pixel
> and right is the integer right of last pixel.
> 
> So left and right are the integers that limit the object, NOT pixel numbers.
> 
> As to your example:
> pixel 1 ranges from 0 to 1, ... pixel 12 ranges from 11 to 12.
> The left is 0, the right is 12, the width is 12=right-left.
> 
>> Richard H. wrote:
>> Playing around with a couple of things needing alignment, I’ve noticed that the math on widths and edges isn’t quite right.
>> For example, I have a boundary rect of width 12, with a left of 0 and a right of 12.
>> One of these is wrong . . . a width of 12 would go from 0 to 11; 0 to 12 is 13 pixels wide . . .
>> It seems that “right” actually means, “the pixel to the right of” . . .
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the use-livecode mailing list