Bug 22163

Summary: [QT] GraphicsContext's currenPath can be transformed
Product: WebKit Reporter: Dirk Schulze <krit>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hausmann
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Undo the transformation
none
theoretical tests
none
Undo the transformation
none
Undo the transformation
none
Undo the transformation hausmann: review+

Description Dirk Schulze 2008-11-10 14:27:21 PST
The currenPath of the GraphicsContext is transformed, when the GraphicsContext is transformed. That shouldn't be the case. 
The path will be drawn using the CTM but shouldn't be transformed itself.
Only beginPath should respect the CTM.
Comment 1 Dirk Schulze 2008-11-10 14:40:02 PST
Created attachment 25027 [details]
Undo the transformation

This patch just undo the transformation to the path. That means new path's still respect the CTM and transformations to the context don't influence the current path.
Comment 2 Dirk Schulze 2008-11-19 00:23:23 PST
Created attachment 25259 [details]
theoretical tests

That are some theoretical test cases. There should be a green rectangle on the top left.
Comment 3 Dirk Schulze 2008-11-19 00:25:56 PST
Created attachment 25260 [details]
Undo the transformation

This patch should match all test cases above.
Comment 4 Dirk Schulze 2008-11-19 07:09:23 PST
Created attachment 25267 [details]
Undo the transformation

Update
Path had to be cleared after the drawing. Added speed up by asking if currentPath is empty before all types of transformation.
Comment 5 Simon Hausmann 2008-11-19 07:28:16 PST
I think the patch looks good, but I also think that "affine" should be called "pathTransform" or so instead. A slightly more descriptive name that relates to the use of the transform with the gc's path.
Comment 6 Dirk Schulze 2008-11-19 09:17:30 PST
Created attachment 25273 [details]
Undo the transformation

You're right. I changed affine to pathTransform.
Comment 7 Simon Hausmann 2008-11-19 23:34:12 PST
Comment on attachment 25273 [details]
Undo the transformation

Great stuff Dirk :)
Comment 8 Dirk Schulze 2008-11-26 07:34:53 PST
landed in r38785.