ImageView.st
changeset 5741 75e825820538
parent 5721 601f7686ccdb
child 5751 1382b5b74d06
equal deleted inserted replaced
5740:dfd1e2063b66 5741:75e825820538
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1993 by Claus Gittinger
     4  COPYRIGHT (c) 1993 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
   645 !ImageView methodsFor:'drawing'!
   647 !ImageView methodsFor:'drawing'!
   646 
   648 
   647 generateMagnifiedImage
   649 generateMagnifiedImage
   648     |adj smooth doFit innerWidth innerHeight imgWidth imgHeight|
   650     |adj smooth doFit innerWidth innerHeight imgWidth imgHeight|
   649 
   651 
   650     image isNil ifTrue:[
   652     image isNil ifTrue:[^ self].
   651         ^ self
   653     smoothMagnifiedImage notNil ifTrue:[^ self].
   652     ].
       
   653 
       
   654     smoothMagnifiedImage notNil ifTrue:[
       
   655         ^ self
       
   656     ].
       
   657     
   654     
   658     adj := adjust.
   655     adj := adjust.
   659     smooth := false.
   656     smooth := false.
   660     (adjust notNil and:[adjust startsWith:#smooth]) ifTrue:[
   657     (adjust notNil and:[adjust startsWith:#smooth]) ifTrue:[
   661         adj := (adjust copyFrom:'smooth' size+1) asLowercaseFirst asSymbol.
   658         adj := (adjust copyFrom:'smooth' size+1) asLowercaseFirst asSymbol.
   745 !
   742 !
   746 
   743 
   747 redrawX:x y:y width:w height:h
   744 redrawX:x y:y width:w height:h
   748     |xI yI depth shownImage imgWidth imgHeight right bott "rectRight rectBelow"|
   745     |xI yI depth shownImage imgWidth imgHeight right bott "rectRight rectBelow"|
   749 
   746 
   750     image notNil ifTrue:[
   747     self generateMagnifiedImage.
   751         self generateMagnifiedImage.
   748 
   752 
   749     shownImage := smoothMagnifiedImage ? magnifiedImage ? image.
   753         shownImage := smoothMagnifiedImage ? magnifiedImage ? image.
   750     shownImage notNil ifTrue:[
   754         imgWidth := shownImage width.
   751         imgWidth := shownImage width.
   755         imgHeight := shownImage height.
   752         imgHeight := shownImage height.
   756 
   753 
   757         adjust == #center ifTrue:[
   754         adjust == #center ifTrue:[
   758             xI := (width - (margin * 2) - imgWidth) // 2.
   755             xI := (width - (margin * 2) - imgWidth) // 2.