[Cuis-dev] Question about LayoutMorph and overlapping fullBoundsInOwner
Nicolás Papagna Maldonado
nicolas.papagna at gmail.com
Thu Apr 3 09:53:28 PDT 2025
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 .
Cheers!
Nico PM
>
> Note how the bottom border of the top box and top border of the bottom box
> are both visible.
>
> On Thu, Apr 3, 2025 at 8:14 AM Nicolás Papagna Maldonado via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> Hi Folks!
>>
>> In the following example I create a layout and add two 100x100 morphs.
>>
>> When I check their bounds in the owner, they seem to "overlap": notice
>> the y=100 coordinate is shared by both morphs (one ends where the next one
>> starts), even though they are not rendered overlapped.
>>
>> layout := LayoutMorph newColumn
>> addMorph: (BoxMorph new morphExtent: 100 at 100);
>> addMorph: (BoxMorph new morphExtent: 100 at 100).
>>
>> layout layoutSubmorphs.
>>
>> layout submorphs second fullBoundsInOwner. 0 at 0 corner: 100 at 100
>> layout submorphs first fullBoundsInOwner. 0 at 100 corner: 100 at 200
>>
>> I found this while trying to find which morph was at the 0 at 100 local
>> position inside the layout.
>>
>> Does this mean that fullBoundsInOwnerdoes not include the end?
>>
>> Cheers,
>> Nico PM
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
--
Nicolás Papagna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250403/36b84d84/attachment.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/36b84d84/attachment.png>
More information about the Cuis-dev
mailing list