<div dir="ltr"><div dir="ltr">On Mon, Aug 12, 2024 at 6:38 PM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 2024-08-12 15:13, Mark Volkmann via Cuis-dev wrote:<br>
<br>
> See the attached screenshot. Hard as I try, I haven't been able to <br>
> figure out why the two red squares are different sizes. They are <br>
> instances of a custom morph named PlaceholderMorph.<br>
<br>
PlaceHolderMorph inherits from PlacedMorph, which supplies a default <br>
LayoutSpec which scales to the space available.<br>
<br>
vvv===vvv<br>
layoutSpec<br>
        "Layout specific. Return the layout spec describing where the<br>
        receiver should appear in a proportional layout"<br>
<br>
        layoutSpec ifNotNil: [ :ls | ^ ls ].<br>
        layoutSpec := LayoutSpec useAll.<br>
        layoutSpec morph: self.<br>
<br>
        ^ layoutSpec<br>
^^^===^^^<br>
<br>
Resizing the outer, containing LayoutMorph demonstrates this.<br>
<br>
The LabelMorphs and PluggableButtonMorphs have default LayoutSpecs which <br>
use the original morphExtent, so they are not scaled.<br>
<br>
Using UI-MetaProperties to view the LayoutSpecs of various morphs and <br>
play with their properties, then dynamically resizing the containing <br>
LayoutMorph should sharpen your intuitions about what to expect.<br></blockquote><div><br></div><div>That helps! Now I have to decide how to address this.</div><div>The only reason I chose to make my PlaceholderMorph be a subclass of PlacedMorph instead of BoxedMorph is that</div><div>with PlacedMorph the canvas passed to drawOn: is a VectorCanvas and</div><div>with BoxedMorph the canvas passed to drawOn: is a HybridCanvas.</div><div>I want to use the polyLine: method in VectorCanvas.</div><div><br></div><div>Is there a way I can configure my custom morph so that if it is a subclass of BoxedMorph, I can get a VectorCanvas in drawTo: ?</div><div><br></div><div>Is it a better option to modify the layoutSpec in the initialize method so it keeps a fixed size?</div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>