Bug 75065

Summary: Transformed symbols sometimes disappear
Product: ksvg Reporter: Jeff Smith <whydoubt>
Component: generalAssignee: Nikolas Zimmermann <wildfox>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Testcase should show four circles
Patches bug in transforming symbols

Description Jeff Smith 2004-02-12 13:49:36 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2 
OS:          Linux

Certain transformations in a 'use' cause the entire symbol not to be drawn.  For instance translate(-1,1) or translate(1,-1).

After a lot of digging in code I found the cause: the clipping box is being flipped by the transform.  This causes everything *inside* the box to be clipped when it should be clipping everything *outside* the box.

I have a patch which fixes this by checking if the box is clockwise after the affine transformation.  If clockwise, flipping two of the vertices corrects it.
Comment 1 Jeff Smith 2004-02-12 14:01:54 UTC
Created attachment 4651 [details]
Testcase should show four circles
Comment 2 Jeff Smith 2004-02-12 14:06:14 UTC
Created attachment 4652 [details]
Patches bug in transforming symbols
Comment 3 Nikolas Zimmermann 2004-02-12 16:28:43 UTC
On Thursday 12 February 2004 13:49, Jeff Smith wrote:
>
> Certain transformations in a 'use' cause the entire symbol not to be drawn.
>  For instance translate(-1,1) or translate(1,-1).
>
> After a lot of digging in code I found the cause: the clipping box is being
> flipped by the transform.  This causes everything *inside* the box to be
> clipped when it should be clipping everything *outside* the box.
>
> I have a patch which fixes this by checking if the box is clockwise after
> the affine transformation.  If clockwise, flipping two of the vertices
> corrects it.

Oh my god :) Thank you very much! Already thought about active ksvg
development? I'd appreciate it...

Bye
 Bye
  Niko


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAK5rzs77DQgSFsQERAsKgAJ4oVsZ4HzcLgrKJQZ+SzwjQOXP0eACfdXRb
zjPcYbuc9A2fNwBMo0g7e80=
=cEI5
-----END PGP SIGNATURE-----

Comment 4 Jeff Smith 2004-02-19 05:17:12 UTC
I fixed this in kdegraphics/ksvg/plugin/backends/libart/LibartCanvas.cpp.
I found that I could do this based on the sign of the determinant of the
transformation matrix, rather than using trig on the vector product.