# HG changeset patch # User Claus Gittinger # Date 1332078232 -3600 # Node ID b24f5e13e6509552767c987d707e5ac7c92e9fd8 # Parent bee1a24df6e414f9a5beafccd414dc6eed8a1f7c changed: #doRotateImage diff -r bee1a24df6e4 -r b24f5e13e650 ImageEditor.st --- a/ImageEditor.st Thu Mar 01 10:52:33 2012 +0100 +++ b/ImageEditor.st Sun Mar 18 14:43:52 2012 +0100 @@ -6176,21 +6176,29 @@ doRotateImage "rotates current image" - |box rotation| - - box := EnterBox new. - box title:(resources string:'Rotate by (degrees, clockwise):'). - box okText:(resources string:'OK'). - box abortText:(resources string:'Cancel'). - box initialText: '0'. - box showAtPointer. - (box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil]) - ifTrue:[ - imageEditView rotateImageBy:rotation. - self updateInfoLabel. - ]. - - "Modified: / 11-11-2007 / 13:21:11 / cg" + |rotationString box rotation| + + rotationString := Dialog + request:(resources string:'Rotate by (degrees, clockwise):') + list:#( '-90' '90' '180' '45' '-45' '135' '-135' ) + initialAnswer:90. + rotationString isEmptyOrNil ifTrue:[^ self]. "/ cancelled + rotation := Number readFrom:rotationString onError:[nil]. + rotation isNil ifTrue:[^ self]. + +"/ box := EnterBox new. +"/ box title:(resources string:'Rotate by (degrees, clockwise):'). +"/ box okText:(resources string:'OK'). +"/ box abortText:(resources string:'Cancel'). +"/ box initialText: '0'. +"/ box showAtPointer. +"/ (box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil]) +"/ ifFalse:[ ^ self ]. + + imageEditView rotateImageBy:rotation. + self updateInfoLabel. + + "Modified: / 18-03-2012 / 14:41:14 / cg" ! doShiftManual