[squeak-dev] Moving SVGMorphs around [was: Bezier filled shape rendering artifacts]

Igor Stasenko siguctua at gmail.com
Tue Mar 25 22:59:52 UTC 2008


On 25/03/2008, Klaus D. Witzel <klaus.witzel at cobss.com> wrote:
> On Tue, 25 Mar 2008 15:29:41 +0100, Igor Stasenko wrote:
>
>  ...
>  > Okay, one more test.
>  > open given morph
>  >
>  > (SVGMorph fromFileStream:
>  >  'http://squeak.cobss.ch/JSesh/resources/glyphs/varia/Y4.svg'
>  >   asUrl retrieveContents contentStream
>  >  ) openInWorld
>
>  This now renders what is expected, have changed width:=height:=180 for
>  {A1,A2,Y3,Y4].svg on the server :)
>
>  > 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.
>
>  You're just duplicating my test code from the other week, which you
>  apparently have never seen before ;-)
>
>  > | 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)
>
>  Now that the glyphs renders OK, did you notice that when alt-click
>  + moving the glyphs farther than their bounding box, then they are blanked
>  (and un-blanked when moved back). Also, some artefacts suddenly appear
>  where the halo-button was located, when moving the SVGMorphs within their
>  bounding box.
>
>  This cannot be a problem with the constants in #defaultViewBox since the
>  parsed viewBox values are respected.
>
Open inspector of SVG Morph and eval:

self position:  (bounds extent -1)
self position:  (bounds extent)

a shape is not drawn simply because submorph (SVGPathMorph) don't
passes visibility test in canvas (.. canvas isVisible: self bounds
...), when it's bounds outside (0 at 0 corner: bounds extent).

A quick dirty hack:
copy SVGPathMorh>>drawOn:
to SVGPathMorh>>fullDrawOn:

I think it's because nesting with MatrixTransformMorph.
The bug is somewhere in it.
Since both SVGMorph and SVGPathMorph subclassed from it,
canvas tranformed twice to start drawing things.

>
>  /Klaus
>
>
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list