{"action":"opened","issue":{"url":"https://api.github.com/repos/musictheory/SwiffCore/issues/20","labels_url":"https://api.github.com/repos/musictheory/SwiffCore/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/musictheory/SwiffCore/issues/20/comments","events_url":"https://api.github.com/repos/musictheory/SwiffCore/issues/20/events","html_url":"https://github.com/musictheory/SwiffCore/issues/20","id":120162485,"number":20,"title":"Masking Problems (fix inside)","user":{"login":"aherbig","id":16133886,"avatar_url":"https://avatars.githubusercontent.com/u/16133886?v=3","gravatar_id":"","url":"https://api.github.com/users/aherbig","html_url":"https://github.com/aherbig","followers_url":"https://api.github.com/users/aherbig/followers","following_url":"https://api.github.com/users/aherbig/following{/other_user}","gists_url":"https://api.github.com/users/aherbig/gists{/gist_id}","starred_url":"https://api.github.com/users/aherbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherbig/subscriptions","organizations_url":"https://api.github.com/users/aherbig/orgs","repos_url":"https://api.github.com/users/aherbig/repos","events_url":"https://api.github.com/users/aherbig/events{/privacy}","received_events_url":"https://api.github.com/users/aherbig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-03T12:44:23Z","updated_at":"2015-12-03T12:44:23Z","closed_at":null,"body":"In the routine:\r\n\r\nstatic void sDrawPlacedObject(SwiffRenderState *state, SwiffPlacedObject *placedObject) \r\nof the SwiffRenderer there are two early returns. \r\n\r\n>    // Bail out if placedObject is hidden\r\n    if (placedObjectIsHidden) { \r\n...\r\n}\r\n\r\nand\r\n\r\n\r\n>    // Bail out if renderBounds is not in the clipBoundingBox\r\n    CGRect renderBounds = CGRectApplyAffineTransform([definition renderBounds], newTransform);\r\n     if (!CGRectIntersectsRect(renderBounds, state->clipBoundingBox)) {\r\n...\r\n}\r\n\r\nIf the code returns at those points, the code needed for correct masking that is at the end of sDrawPlacedObject never gets called and there are display errors.\r\n\r\n> if (placedObjectClipDepth) {\r\n        sStartClipping(state, placedObjectClipDepth);\r\n        state->isBuildingClippingPath = NO;\r\n        state->skipUntilClipDepth = NO;\r\n    }\r\n\r\nFixed it by copying that last code snippet right before the return calls above."}}