[BUG] [FIX] ( [sm] PolygonDeleteHandleFix

Peace Jerome peace_the_dreamer at yahoo.com
Thu Apr 15 22:12:19 UTC 2004


--- Frank Caggiano <frank at crystal-objects.com> wrote:
> Peace Jerome wrote:
> 
> > 
> > Wait I just read seven again. Moving a yellow
> handle over another yellow 
> > handle gives you a polygon with one less vertex
> and therefore one less 
> > yellow handle. Thats what I meant by deleting
> handles not the x halo 
> > handle for the polygon handle. I got fascinated by
> this trick and found 
> > the bug when I carried it to its logical if
> nonsensical conclusion just 
> > to satisfy a curiosity.
> > 
> 
> Ok this did it! Finally we're on the same page.
> Now looking through your messages I can't seem to
> find one that has the 
> fix attached :-(
> 
> I would suggest you submit a NEW bug report/fix with
> an attached cs. 
> I'll then be able to test it out and get this
> resolved.
> 
> regards
> -- 
> Frank Caggiano				
> 

Ok. I am not directly on the internet so I can't
submit the fixes with squeaks help. I could use some
feedback as to what works and what works best. I've
added as attachments the text version of the change
set and the gzipped (via Easy-GZ ) version. To make
sure below is the pasted text of the change set as
well:

'From Squeak3.7alpha of 11 September 2003 [latest
update: #5816] on 13 March 2004 at 3:31:21 pm'!
"Change Set:		PolygonDropHandleFix
Date:			13 March 2004
Author:			wiz (Jerome Peace)

Prevent moving a drop handle from deleting the last
vertex."!


!PolygonMorph methodsFor: 'editing' stamp: 'wiz
3/13/2004 15:23'!
dropVertex: ix event: evt fromHandle: handle
	| p |
	p _ vertices at: ix.
	"Check for too few vertices before deleting. The
alternative is not pretty -wiz"
	((vertices size >= 2) and:
	[(((vertices atWrap: ix-1) dist: p) < 3 or:
		[((vertices atWrap: ix+1) dist: p) < 3])])
		ifTrue: ["Drag a vertex onto its neighbor means
delete"
				self setVertices: (vertices copyReplaceFrom: ix
to: ix with: Array new)].
	evt shiftPressed
		ifTrue: [self removeHandles]
		ifFalse: [self addHandles "remove then add to
recreate"]! !

Yours in service, --Jer





	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html
-------------- next part --------------
'From Squeak3.7alpha of 11 September 2003 [latest update: #5816] on 13 March 2004 at 3:31:21 pm'!
"Change Set:		PolygonDropHandleFix
Date:			13 March 2004
Author:			wiz (Jerome Peace)

Prevent moving a drop handle from deleting the last vertex."!


!PolygonMorph methodsFor: 'editing' stamp: 'wiz 3/13/2004 15:23'!
dropVertex: ix event: evt fromHandle: handle
	| p |
	p _ vertices at: ix.
	"Check for too few vertices before deleting. The alternative is not pretty -wiz"
	((vertices size >= 2) and:
	[(((vertices atWrap: ix-1) dist: p) < 3 or:
		[((vertices atWrap: ix+1) dist: p) < 3])])
		ifTrue: ["Drag a vertex onto its neighbor means delete"
				self setVertices: (vertices copyReplaceFrom: ix to: ix with: Array new)].
	evt shiftPressed
		ifTrue: [self removeHandles]
		ifFalse: [self addHandles "remove then add to recreate"]! !

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolygonDropHandleFix.1.cs.gz
Type: application/x-gzip
Size: 528 bytes
Desc: PolygonDropHandleFix.1.cs.gz
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040415/672495f5/PolygonDropHandleFix.1.cs.bin


More information about the Squeak-dev mailing list