<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Bernhard --<div><br></div><div>> <span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">I wonder if this is a bug? Or does one have to send a special message to a morph after adding submorphs to it?</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">For several reasons, layout computation is lazy, normally triggered by the drawing cycle via #fullBounds. You can verify that by calling #openInWorld on that rowMorph. It will look correct.</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">As a rule of thumb, you should not write such layout-specific code "manually" (e.g. override #extent:) but always use a (custom) LayoutPolicy. At best, you can compose your entire morph hierarchy with the existing layout policies, configured to your needs (e.g. #hResizing:, #listCentering:, ...).</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">If you want to debug your layout, try this:</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">rowMorph fullBounds. </span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">{stringMorph extent. rowMorph extent}.</span><br></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px"><br></span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px">Or this:</span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px"><br></span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px">rowMorph layoutComputed</span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px">   ifFalse: [rowMorph doLayoutSafely].</span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">{stringMorph extent. rowMorph extent}.</span><span style="font-family: Arial, Helvetica, sans-serif"><span style="font-size: 13px"><br></span></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Hope this helps. :-)</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Marcel</span></div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 17.07.2021 21:51:17 schrieb Bernhard Pieber <bernhard@pieber.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">Hi,<br><br>I would have expected that when I wrap a morph in another morph, which has resizing set to #shrinkWrap, that the wrapping morph should have the same extent as the wrapped morph. However, this seems not to be the case:<br><br>| stringMorph rowMorph |<br>stringMorph := 'Morphic is great' asMorph.<br><br>rowMorph := Morph new color: Color transparent;<br>     layoutPolicy: TableLayout new;<br>        listDirection: #leftToRight;<br>  hResizing: #shrinkWrap;<br>       vResizing: #shrinkWrap;<br>       yourself.<br>rowMorph addMorph: stringMorph.<br><br>{stringMorph extent. rowMorph extent}. {97@14 . 50@40}<br><br>I wonder if this is a bug? Or does one have to send a special message to a morph after adding submorphs to it?<br><br>Cheers,<br>Bernhard<br><br></div></blockquote></div>