Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transform on clipped images #437

Merged
merged 1 commit into from
Jun 27, 2018
Merged

Conversation

stephsharp
Copy link
Contributor

transform-fix

Note: depends on #436

@stephsharp
Copy link
Contributor Author

stephsharp commented Jun 25, 2018

Investigating the broken test.

Clip is missing when parsing masking-path-02-b-manual:

          "clip" : {
            "x" : 60,
            "w" : 80,
            "type" : "Rect",
            "y" : 60,
            "h" : 80
          }

Looks like TransformedLocus is not Serializable.

@f3dm76
Copy link
Collaborator

f3dm76 commented Jun 26, 2018

Hello, Thank you very much for your contribution. About the test, you are right. I added serialization for TransformedLocus. We'll let you know once it is merged

@f3dm76
Copy link
Collaborator

f3dm76 commented Jun 26, 2018

Hello again, TransformedLocus serialization was merged to master, could you please renew the pull request to restart the tests?

@stephsharp stephsharp force-pushed the fix-transform branch 2 times, most recently from 16f89a0 to 6abb303 Compare June 26, 2018 14:54
@@ -1393,6 +1393,9 @@ open class SVGParser {
let transform = transformBoundingBoxLocus(respectiveLocus: userSpaceLocus.locus, absoluteLocus: locus)
return TransformedLocus(locus: userSpaceLocus.locus, transform: transform)
}
if let userSpaceTransform = userSpaceLocus.transform, userSpaceTransform != Transform.identity {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check here to only return a TransformedLocus if the transform is not the identity matrix.

@stephsharp
Copy link
Contributor Author

Thanks @f3dm76, tests are passing now!

@f3dm76
Copy link
Collaborator

f3dm76 commented Jun 27, 2018

Hello, looks good, but it seems like it's easier to just put TransformedLocus directly into UserSpaceLocus.locus. Then there's no need for UserSpaceLocus.transform at all.

@stephsharp
Copy link
Contributor Author

Great idea! I've updated the PR.

@ystrot ystrot added this to the 0.9.2 milestone Jun 27, 2018
@ystrot ystrot self-assigned this Jun 27, 2018
@ystrot ystrot merged commit 30dc952 into exyte:master Jun 27, 2018
@ystrot
Copy link
Member

ystrot commented Jun 27, 2018

Hi Stephanie,

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants