[squeak-dev] Re: Bezier filled shape rendering artifacts
Igor Stasenko
siguctua at gmail.com
Tue Mar 25 14:29:41 UTC 2008
On 25/03/2008, Gary Chambers <gazzaguru2 at btinternet.com> wrote:
> Though I did find a bug (rarely encountered) in
> SVGPathMorph>>createSegmentsFromSVG.
>
> Replace
>
> data do: [:cmd |
> ((cmd = $S or: [cmd = $s]) and: ['CcSs' includes: c not])
> ifTrue: [lastCubicControl := position].
> ((cmd = $T or: [cmd = $t]) and: ['QqTt' includes: c not])
> ifTrue: [lastQuadraticControl := position].
>
> with
>
> data do: [:cmd |
> ((cmd key = $S or: [cmd key = $s]) and: ['CcSs' includes: c not])
> ifTrue: [lastCubicControl := position].
> ((cmd key = $T or: [cmd key = $t]) and: ['QqTt' includes: c not])
> ifTrue: [lastQuadraticControl := position].
>
Hmm..
is this correct notation: " 'CcSs' includes: c not "
maybe more correct should be ('CcSs' includes: c) not ?
and same for ('QqTt' includes: c) not
>
> Also, never did get to the bottom of why the page bounds sometimes come out
> wrong... (perhaps because taken from the SVG rather than computed
> "after-the-fact").
>
> Glad someone is still using the old SVGMorph "experiment"!
Okay, one more test.
open given morph
(SVGMorph fromFileStream:
'http://squeak.cobss.ch/JSesh/resources/glyphs/varia/Y4.svg'
asUrl retrieveContents contentStream
) openInWorld
then inspect SVGPathMorph submorph and evaluate following:
2 to: segments size do: [:i | self assert:(segments at:i) start =
(segments at:i-1) end ]
Does endpoints of adjusted segments should be equal?
Because this test shows that some are not.
| good bad |
good := bad := 0.
2 to: segments size do: [:i | (segments at:i) start = (segments
at:i-1) end ifTrue: [ good := good +1] ifFalse: [ bad := bad +1 ] ].
{ good. bad }
prints: #(86 8)
>
> Regards, Gary.
--
Best regards,
Igor Stasenko AKA sig.
More information about the Squeak-dev
mailing list
|