ImageEditView.st
changeset 4624 bc987849ea84
parent 4623 efe94f736058
child 4646 b1faa362e0ac
equal deleted inserted replaced
4623:efe94f736058 4624:bc987849ea84
  1112     "Modified: / 10.2.2000 / 23:37:04 / cg"
  1112     "Modified: / 10.2.2000 / 23:37:04 / cg"
  1113 !
  1113 !
  1114 
  1114 
  1115 flipSubImage:how in:imageBox
  1115 flipSubImage:how in:imageBox
  1116     "/ now, do it
  1116     "/ now, do it
       
  1117     "/ caveat: this should go into image class
  1117 
  1118 
  1118     |x0 y0 x1 y1 image t|
  1119     |x0 y0 x1 y1 image t|
  1119 
  1120 
  1120     self makeUndo.
  1121     self makeUndo.
  1121 
  1122 
  1130         0 to:((y1-y0)//2) do:[:dy |
  1131         0 to:((y1-y0)//2) do:[:dy |
  1131             x0 to:x1 do:[:x |
  1132             x0 to:x1 do:[:x |
  1132                 t := image pixelAtX:x y:(y0+dy).
  1133                 t := image pixelAtX:x y:(y0+dy).
  1133                 image pixelAtX:x y:(y0+dy) put:(image pixelAtX:x y:(y1-dy)).
  1134                 image pixelAtX:x y:(y0+dy) put:(image pixelAtX:x y:(y1-dy)).
  1134                 image pixelAtX:x y:(y1-dy) put:t.
  1135                 image pixelAtX:x y:(y1-dy) put:t.
  1135 
  1136                 image mask notNil ifTrue:[
  1136                 t := image maskAtX:x y:(y0+dy).
  1137                     t := image maskAtX:x y:(y0+dy).
  1137                 image maskAtX:x y:(y0+dy) put:(image maskAtX:x y:(y1-dy)).
  1138                     image maskAtX:x y:(y0+dy) put:(image maskAtX:x y:(y1-dy)).
  1138                 image maskAtX:x y:(y1-dy) put:t.
  1139                     image maskAtX:x y:(y1-dy) put:t.
       
  1140                 ].
  1139             ].
  1141             ].
  1140         ]
  1142         ]
  1141     ] ifFalse:[
  1143     ] ifFalse:[
  1142         0 to:((x1-x0)//2) do:[:dx |
  1144         0 to:((x1-x0)//2) do:[:dx |
  1143             y0 to:y1 do:[:y |
  1145             y0 to:y1 do:[:y |
  1144                 t := image pixelAtX:(x0+dx) y:y.
  1146                 t := image pixelAtX:(x0+dx) y:y.
  1145                 image pixelAtX:(x0+dx) y:y put:(image pixelAtX:(x1-dx) y:y).
  1147                 image pixelAtX:(x0+dx) y:y put:(image pixelAtX:(x1-dx) y:y).
  1146                 image pixelAtX:(x1-dx) y:y put:t.
  1148                 image pixelAtX:(x1-dx) y:y put:t.
  1147 
  1149 
  1148                 t := image maskAtX:(x0+dx) y:y.
  1150                 image mask notNil ifTrue:[
  1149                 image maskAtX:(x0+dx) y:y put:(image maskAtX:(x1-dx) y:y).
  1151                     t := image maskAtX:(x0+dx) y:y.
  1150                 image maskAtX:(x1-dx) y:y put:t.
  1152                     image maskAtX:(x0+dx) y:y put:(image maskAtX:(x1-dx) y:y).
       
  1153                     image maskAtX:(x1-dx) y:y put:t.
       
  1154                 ].
  1151             ].
  1155             ].
  1152         ]
  1156         ]
  1153     ].
  1157     ].
  1154 
  1158 
  1155     self setModified.
  1159     self setModified.
  2788 ! !
  2792 ! !
  2789 
  2793 
  2790 !ImageEditView class methodsFor:'documentation'!
  2794 !ImageEditView class methodsFor:'documentation'!
  2791 
  2795 
  2792 version
  2796 version
  2793     ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.260 2014-06-22 09:08:15 cg Exp $'
  2797     ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.261 2014-06-22 09:09:54 cg Exp $'
  2794 !
  2798 !
  2795 
  2799 
  2796 version_CVS
  2800 version_CVS
  2797     ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.260 2014-06-22 09:08:15 cg Exp $'
  2801     ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.261 2014-06-22 09:09:54 cg Exp $'
  2798 ! !
  2802 ! !
  2799 
  2803 
  2800 
  2804 
  2801 ImageEditView initialize!
  2805 ImageEditView initialize!