Hi Adrian,

> I'm using a qx.ui.embed.Canvas object to later get WebGL context, but
> it seems this object doesn't correctly communicate it's size (set in the
> constructor) to parent objects. 
The width and height coordinates which can be set in the constructor are only 
for internal size of the Canvas element and not for the container surrounding 
it.

> The resulting space where the canvas is shown is only around 100x50px
> wide, not 600x600.
The Canvas element itself does have the right dimension (take a look at the 
FireBug DOM tab), but the container holding the Canvas element is indeed too 
small.


> // Create the canvas element to render WebGL in
> var canvas = new qx.ui.embed.Canvas(600, 600);
> // Add it to the left side of the UI
> leftContainer.add(canvas);
Instead of this code you can write:

--snip--
var canvas = new qx.ui.embed.Canvas();
canvas.set({ width: 600, height: 600, syncDimension: true });

// Add it to the left side of the UI
leftContainer.add(canvas);
--snip--

This way the *container* does have the right size (600x600) and will sync the 
Canvas element using the "syncDimension" property.

Regards,
  Alex

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to