I'm using Canvas, I need to get a property from the context:
context.webkitBackingStorePixelRatio;
I'm not sure how to make a jsni function to do this (this property does not seem to have a wrapper already in the gwt Context2d class):
// How do we define this function and pass in our GWT Context2d instance?
public static native double getBackingStoreRatio(Context2d context) /*-{
return context.webkitBackingStorePixelRatio || 1;
}-*/;
Canvas canvas = Canvas.createIfSupported();
Context2d context = canvas.getContext2d();
double isThatRight = getBackingStoreRation(context);
Yeah I'm not sure what the sytax is for this, the Context2d variable is a GWT object already,
Thanks
(trying to get the variables from this article for hdpi screen support)
http://www.html5rocks.com/en/tutorials/canvas/hidpi/
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/CXpTjSUEu9oJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment