[squeak-dev] Re: Bezier filled shape rendering artifacts

Klaus D. Witzel klaus.witzel at cobss.com
Mon Mar 24 21:29:46 UTC 2008


On Mon, 24 Mar 2008 15:13:57 +0100, Igor Stasenko wrote:

> I found it, (typed SWG in search :)

:)

> Your script not works.
> There is no #fromFileStream: at class side.

!SVGMorph class methodsFor: 'as yet unclassified' stamp: 'gvc 10/17/2005  
17:39'!
fromFileStream: aStream
	"Open an SVGMorph from the given stream."

	|sx doc|
	sx := aStream.
	(aStream name endsWith: 'svgz')
		ifTrue: [aStream binary.
				sx := (GZipReadStream on: aStream contentsOfEntireFile) upToEnd  
asString readStream].
	doc :=(XMLDOMParser parseDocumentFrom: sx).
	^self new createFromSVGDocument: doc! !


> I used following:
>
> |doc|
> doc:= XMLDOMParser parseDocumentFrom:
> 'http://squeak.cobss.ch/JSesh/resources/glyphs/varia/Y4.svg'
>   asUrl retrieveContents contentStream.
> (SVGMorph new createFromSVGDocument: doc) openInWorld

Sure, that does it as well (it's the same).

> in result i got a tiny morph with little image in top-left corner of
> screen.

Just alt-click it and resize it (the little halo button in the  
bottom-right ;-)

> Once i trying to move it, image disappears, and if move back -
> it appears again. Looks like it's doesn't handle well coordinates.

This one seems to be quite a different problem which I have as yet not  
investigated (but I know it also happens when putting these morphs into a  
window). The question with this one would be, "if it renders when resized,  
why doesn't it so when moved".

But the currently interesting question is, given the example path/bezier  
segments, is there a bug with the engine or why doesn't it render what the  
platform browser does render. There are many examples of SVG+xml files for  
which there isn't this sort of problems; example

- http://squeak.cobss.ch/seaside/sextant (a living Squeak desktop rendered  
by a running Seaside server on the fly).

But I'm currently more interested to get rid of the problems with the  
path/bezier segments of

- http://squeak.cobss.ch/JSesh/resources/glyphs/varia/Y4.svg

/Klaus




More information about the Squeak-dev mailing list