Skip to content

Commit

Permalink
Fixed the shrunk image problem in invalidating CoreAnimation mode & C…
Browse files Browse the repository at this point in the history
…hrome
  • Loading branch information
Nick Zitzmann authored and Nick Zitzmann committed Oct 13, 2010
1 parent ffd4fdd commit 2e89226
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ NPError NPP_SetWindow(NPP instance, NPWindow* window)
obj->boundingBox = CGContextGetClipBoundingBox(context);
}*/
obj->window = *window;
// Workaround for a bug in Chrome where the layer frame size is set too late, causing us to draw at a fraction of our size if CoreAnimation is in use:
if (window && obj->caLayer)
{
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithBool:YES] forKey:kCATransactionDisableActions]; // don't animate this
obj->caLayer.frame = CGRectMake(0.0, 0.0, obj->window.width, obj->window.height);
[CATransaction commit];
}
return NPERR_NO_ERROR;
}

Expand Down

0 comments on commit 2e89226

Please sign in to comment.