Label.st
changeset 6326 0f54a0b990b8
parent 6297 d664b5423622
child 6352 2804a3e767e7
equal deleted inserted replaced
6325:65ee97be5c66 6326:0f54a0b990b8
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  1224         self newLayout
  1226         self newLayout
  1225     ]
  1227     ]
  1226 
  1228 
  1227     "Modified: / 13-04-1996 / 11:17:58 / cg"
  1229     "Modified: / 13-04-1996 / 11:17:58 / cg"
  1228     "Modified (comment): / 13-02-2017 / 20:26:28 / cg"
  1230     "Modified (comment): / 13-02-2017 / 20:26:28 / cg"
       
  1231     "Modified (comment): / 24-05-2018 / 11:30:04 / Claus Gittinger"
  1229 !
  1232 !
  1230 
  1233 
  1231 extraMarginForBorder
  1234 extraMarginForBorder
  1232     "some (round) borders may need more space"
  1235     "some (round) borders may need more space"
  1233     
  1236     
  1692      or the center ?
  1695      or the center ?
  1693      (for text, the center seems better. 
  1696      (for text, the center seems better. 
  1694       For images, I don't really know ...)
  1697       For images, I don't really know ...)
  1695      The commented code below makes the origin visible
  1698      The commented code below makes the origin visible
  1696    "
  1699    "
  1697 "/    (labelHeight < height) ifTrue:[
  1700     "/    (labelHeight < height) ifTrue:[
  1698 "/        y := (height - labelHeight) // 2
  1701     "/        y := (height - labelHeight) // 2
  1699 "/    ] ifFalse:[
  1702     "/    ] ifFalse:[
  1700 "/        y := 0
  1703     "/        y := 0
  1701 "/    ].
  1704     "/    ].
  1702 
  1705 
  1703     "always center vertically"
  1706     "always center vertically"
  1704     y := (height - labelHeight) // 2.
  1707     y := (height - labelHeight) // 2.
  1705 
  1708 
  1706     labelOriginY := y.
  1709     labelOriginY := y.
  1741             x := width - labelWidth - margin - self extraMarginForBorder
  1744             x := width - labelWidth - margin - self extraMarginForBorder
  1742         ]
  1745         ]
  1743     ].
  1746     ].
  1744     labelOriginX := x
  1747     labelOriginX := x
  1745 
  1748 
  1746     "Modified: 13.5.1996 / 10:55:17 / cg"
  1749     "Modified: / 13-05-1996 / 10:55:17 / cg"
       
  1750     "Modified: / 24-05-2018 / 11:30:09 / Claus Gittinger"
  1747 !
  1751 !
  1748 
  1752 
  1749 computeLabelSize
  1753 computeLabelSize
  1750     "compute the extent needed to hold the logo"
  1754     "compute the extent needed to hold the logo"
  1751 
  1755