# HG changeset patch # User Claus Gittinger # Date 998498343 -7200 # Node ID 18f7b6cc2514023f3960a0eaf3e0b11ab9e375dc # Parent 0d8a60f173387bba93f68cf240ff885ff526f633 *** empty log message *** diff -r 0d8a60f17338 -r 18f7b6cc2514 ImageEditor.st --- a/ImageEditor.st Tue Aug 21 17:52:48 2001 +0200 +++ b/ImageEditor.st Wed Aug 22 18:39:03 2001 +0200 @@ -1062,6 +1062,12 @@ #activeHelpKey: #editMagnifyImage ) #(#MenuItem + #label: 'Magnify By...' + #translateLabel: true + #value: #doMagnifyImageBy + #activeHelpKey: #editMagnifyImage + ) + #(#MenuItem #label: 'Rotate...' #translateLabel: true #value: #doRotateImage @@ -2854,7 +2860,7 @@ ! doMagnifyImage - "magnifies current image" + "magnifies the current image to a new size" |box newSize image| @@ -2869,6 +2875,39 @@ (box accepted and: [(newSize := Object readFromString:(box contents) onError:nil) notNil]) ifTrue:[ + newSize isPoint ifFalse:[ + self warn:'please enter the new size as ''x @ y''.'. + ^ self. + ]. + imageEditView magnifyImageTo:newSize. + ]. + + self updateInfoLabel +! + +doMagnifyImageBy + "magnifies the current image (by a scale)" + + |box oldSize newSize scale image| + + image := imageEditView image. + oldSize := image extent. + + box := EnterBox new. + box title:(resources string:'Scale factor (<1 to shrink; >1 to magnify):'). + box okText:(resources string:'OK'). + box abortText:(resources string:'Cancel'). + box initialText:1 printString. + box showAtPointer. + + (box accepted + and: [(scale := Object readFromString:(box contents) onError:nil) notNil]) + ifTrue:[ + scale isNumber ifFalse:[ + self warn:'please enter a scale factor (<1 to shrink; >1 to magnify).'. + ^ self. + ]. + newSize := oldSize * scale. imageEditView magnifyImageTo:newSize. ].