'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 17 October 2007 at 10:59:46 pm'! "Change Set: sketchPolygonUndo-nice Date: 5 November 2007 Author: Nicholas Cellier Fixes a bug in use of undo in the painting tool when in polygon mode. Gleaned from Mantis 6732, and vetted and harvested for olpc by Scott Wallace - sw 2/26/2008 14:48 "! !SketchEditorMorph methodsFor: 'actions & preps' stamp: 'nice 10/17/2007 22:44'! polyFreeze "A live polygon is on the painting. Draw it into the painting and delete it." | poly | self polyEditing ifFalse:[^self]. (poly _ self valueOfProperty: #polygon) ifNil: [self polyEditing: false. ^ self]. poly drawOn: formCanvas. poly delete. self setProperty: #polygon toValue: nil. self polyEditing: false.! ! !SketchEditorMorph methodsFor: 'start & finish' stamp: 'nice 10/17/2007 22:59'! undo: evt "revert to a previous state. " | temp poly pen | self flag: #bob. "what is undo in multihand environment?" undoBuffer ifNil: [^Beeper beep]. "nothing to go back to" (poly := self valueOfProperty: #polygon) ifNotNil: [poly delete. self setProperty: #polygon toValue: nil. self polyEditing: false. ^self]. temp := paintingForm. paintingForm := undoBuffer. undoBuffer := temp. "can get back to what you had by undoing again" pen := self get: #paintingFormPen for: evt. pen ifNil: [^Beeper beep]. pen setDestForm: paintingForm. formCanvas := paintingForm getCanvas. "used for lines, ovals, etc." formCanvas := formCanvas copyOrigin: self topLeft negated clipRect: (0 @ 0 extent: bounds extent). self render: bounds! !