<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Another example which reads a JPG file from the directory
      'Cuis-Smalltalk-Dev-master-UserFiles'.</p>
    <p>The picture file is 2258 x 1505 pixel in size.</p>
    <p>However the layout morph does not shrink to the size of the bear
      picture. It remains much larger.</p>
    <p>What am I missing here?</p>
    <p>Regards,</p>
    <p>Hannes<br>
    </p>
    <p><br>
    </p>
    <p>labelMorph := LabelMorph new<br>
        borderWidth: 2;<br>
        borderColor: Color red;<br>
        color: Color cyan;<br>
        padding: 0.<br>
      <br>
      aForm := Form fromFileEntry: '920.bear.jpg' asFileEntry.<br>
      "aForm inspect"<br>
      <br>
      imageMorph := ImageMorph newWith: aForm.<br>
      imageMorph<br>
         borderWidth: 6;<br>
         borderColor: Color green;<br>
         scaleBy: 0.2;<br>
         padding: 0.<br>
      <br>
      layoutMorph := LayoutMorph newColumn<br>
          borderWidth: 2;<br>
          borderColor: Color yellow;<br>
          padding: 0;<br>
          separation: 0;<br>
          addMorph: labelMorph;<br>
          addMorph: imageMorph;<br>
          openInWorld<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p>labelMorph := LabelMorph new<br>
        borderWidth: 2;<br>
        borderColor: Color red;<br>
        color: Color cyan;<br>
        padding: 0.<br>
      <br>
      aForm := Form fromFileEntry: '920.bear.jpg' asFileEntry.<br>
      "aForm inspect"<br>
      <br>
      imageMorph := ImageMorph newWith: aForm.<br>
      imageMorph<br>
         borderWidth: 6;<br>
         borderColor: Color green;<br>
         scaleBy: 0.2;<br>
         padding: 0.<br>
      <br>
      layoutMorph := LayoutMorph newColumn<br>
          borderWidth: 2;<br>
          borderColor: Color yellow;<br>
          padding: 0;<br>
          separation: 0;<br>
          addMorph: labelMorph;<br>
          addMorph: imageMorph;<br>
          openInWorld<br>
    </p>
    <div class="moz-cite-prefix">On 12/11/2024 11:06 pm, Hannes Hirzel
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c97869ec-3488-451b-a8a2-ee9acd26f775@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>P.S.<br>
      </p>
      <p>Removed duplicated code <br>
      </p>
      <p><br>
      </p>
      <p>labelMorph := LabelMorph new<br>
          borderWidth: 2;<br>
          borderColor: Color red;<br>
          color: Color cyan;<br>
          padding: 0.<br>
        <br>
        imageMorph := ImageMorph new<br>
           borderWidth: 6;<br>
           borderColor: Color green;<br>
           padding: 0.<br>
        <br>
        layoutMorph := LayoutMorph newColumn<br>
            borderWidth: 2;<br>
            borderColor: Color yellow;<br>
            padding: 0;<br>
            separation: 0;<br>
            addMorph: labelMorph;<br>
            addMorph: imageMorph;<br>
            scaleBy: 3;<br>
            openInWorld.<br>
        <br>
        <br>
        labelMorph padding: 4.<br>
        <br>
        labelMorph padding: 6.<br>
        <br>
        labelMorph padding: 8.<br>
        <br>
        layoutMorph padding:0; morphExtent: layoutMorph minimumExtent.<br>
        <br>
        layoutMorph separation: 3.<br>
        <br>
        LayoutMorph exampleEdgesColumn.<br>
        LayoutMorph exampleEdgesRow.<br>
      </p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p><br>
      </p>
      <div class="moz-cite-prefix">On 12/11/2024 4:02 pm, H. Hirzel
        wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAGQxfVjzpMovSaZZrfX0S_8iDFab3XhBHMqP+P0wR-vtQGVDKQ@mail.gmail.com">
        <meta http-equiv="content-type"
          content="text/html; charset=UTF-8">
        <div dir="ltr">Hello
          <div><br>
          </div>
          <div>I was watching the Box Morph video (Sep 2024, link is on
            <a href="https://cuis.st/community" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://cuis.st/community</a>)
            with interest.</div>
          <div><br>
          </div>
          <div>I like that padding works similar to CSS.</div>
          <div><br>
          </div>
          <div>Below is the workspace code used for the demo four your
            convenience in case you need it.</div>
          <div><br>
          </div>
          <div>Regards</div>
          <div>Hannes</div>
          <div><br>
          </div>
          <div>----------------------------------------------</div>
          <div>File: PadWorkSpace.st</div>
          <div>
            <div>----------------------------------------------</div>
            <br class="gmail-Apple-interchange-newline">
          </div>
          <div><br>
            <br>
            labelMorph := LabelMorph new<br>
              borderWidth: 2;<br>
              borderColor: Color red;<br>
              color: Color cyan;<br>
              padding: 0.<br>
            <br>
            imageMorph := ImageMorph new<br>
               borderWidth: 6;<br>
               borderColor: Color green;<br>
               padding: 0.<br>
            <br>
            layoutMorph := LayoutMorph new<br>
                borderWidth: 2;<br>
                borderColor: Color yellow;<br>
                padding: 0;<br>
                separation: 0;<br>
                addMorph: labelMorph;<br>
                addMorph: imageMorph;<br>
                scaleBy: 3;<br>
                openInWorld.<br>
            <br>
            labelMorph := LabelMorph newColumn<br>
              borderWidth: 2;<br>
              borderColor: Color red;<br>
              color: Color cyan;<br>
              padding: 0.<br>
            <br>
            imageMorph := ImageMorph new<br>
               borderWidth: 6;<br>
               borderColor: Color green;<br>
               padding: 0.<br>
            <br>
            layoutMorph := LayoutMorph new<br>
                borderWidth: 2;<br>
                borderColor: Color yellow;<br>
                padding: 0;<br>
                separation: 0;<br>
                addMorph: labelMorph;<br>
                addMorph: imageMorph;<br>
                scaleBy: 3;<br>
                openInWorld.<br>
            <br>
            <br>
            labelMorph := LabelMorph new<br>
              borderWidth: 2;<br>
              borderColor: Color red;<br>
              color: Color cyan;<br>
              padding: 0.<br>
            <br>
            imageMorph := ImageMorph new<br>
               borderWidth: 6;<br>
               borderColor: Color green;<br>
               padding: 0.<br>
            <br>
            layoutMorph := LayoutMorph newColumn<br>
                borderWidth: 2;<br>
                borderColor: Color yellow;<br>
                padding: 0;<br>
                separation: 0;<br>
                addMorph: labelMorph;<br>
                addMorph: imageMorph;<br>
                scaleBy: 3;<br>
                openInWorld.<br>
            <br>
            labelMorph padding: 4.<br>
            <br>
            labelMorph padding: 6.<br>
            <br>
            labelMorph padding: 8.<br>
            <br>
            layoutMorph padding:0; morphExtent: layoutMorph
            minimumExtent.<br>
            <br>
            layoutMorph padding:0; morphExtent: layoutMorph
            minimumExtent.<br>
            <br>
            layoutMorph separation: 3.<br>
            <br>
            LayoutMorph exampleEdgesColumn.<br>
            LayoutMorph exampleEdgesRow.<br>
          </div>
          <div><br>
          </div>
        </div>
      </blockquote>
    </blockquote>
  </body>
</html>