[Cuis-dev] Question about LayoutMorph and overlapping fullBoundsInOwner

Mark Volkmann r.mark.volkmann at gmail.com
Thu Apr 3 10:03:36 PDT 2025


On Thu, Apr 3, 2025 at 11:54 AM Nicolás Papagna Maldonado <
nicolas.papagna at gmail.com> wrote:

> Hi Mark!
>
> On Thu, Apr 3, 2025 at 1:29 PM Mark Volkmann <r.mark.volkmann at gmail.com>
> wrote:
>
>> I'm thinking that "one ends where the next one starts" does not mean they
>> overlap.
>> I guess you could say they share a border.
>>
> Yup, that's what I meant. They do not share a border, but their
> fullBoundsInOwner imply they do.
>
>> I did the following to make it more clear:
>>
>> box1 := BorderedBoxMorph new morphExtent: 100 at 100; borderColor: Color
>> yellow; borderWidth: 2.
>> box2 := BorderedBoxMorph new morphExtent: 100 at 100; borderColor: Color
>> red; borderWidth: 2.
>> layout := LayoutMorph newColumn addMorph: box1; addMorph: box2.
>> layout openInWorld.
>>
>
> Thanks for the example!
> I used a 20px border to make it more visible.
>
> [image: image.png]
>
> They don't share a border looking at fullBoundsInOwner it looks like they
> do: one ends at y=100 (100 at 100) and the next one starts at y=100 (0 at 100).
> Would't this imply that their extent is 101 at 101 px wide?
>
> box1 fullBoundsInOwner ======> 0 at 0 corner: 100 at 100 .
> box2 fullBoundsInOwner =======>  0 at 100 corner: 100 at 200 .
>

I don't think so.
If you think of the numbers like pixels, you could interpret 0 to 100
to mean occupying the pixels at 0, 1, 2, ..., 100 which is 101 pixels.
But if you think of the numbers like measurements then 100 - 0 is 100, not
101.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250403/6ba9b5e3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 5427 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250403/6ba9b5e3/attachment-0001.png>


More information about the Cuis-dev mailing list