Bug 75065 - Transformed symbols sometimes disappear
Summary: Transformed symbols sometimes disappear
Status: RESOLVED WORKSFORME
Alias: None
Product: ksvg
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Nikolas Zimmermann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-12 13:49 UTC by Jeff Smith
Modified: 2004-02-19 05:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase should show four circles (1008 bytes, image/svg+xml)
2004-02-12 14:01 UTC, Jeff Smith
Details
Patches bug in transforming symbols (1.02 KB, patch)
2004-02-12 14:06 UTC, Jeff Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
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.