[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Mysterious extra padding below canvas



What exactly are you trying to measure?  You might be able to get what
you want by putting a spacer DIV where you want the canvas area (with
block positioning) and let the canvas have absolute positioning in the
same spot.  The DIV will participate in the page layout, and you can
control the canvas layout by querying the DIV and setting the canvas
size via Javascript.

Though I'm not sure what your goal is.  There may be a simpler way to
get what you want.

-T

On Fri, Nov 12, 2010 at 9:52 AM, Mark Callow <callow_mark@hicorp.co.jp> wrote:
> When I have other elements on a page together with a canvas, in order to
> compute an ideal canvas size, I need to query, or compute, things like the
> margin, border and padding heights of elements, particularly the body
> element. I have not so far found any way through the DOM to obtain this
> information.  The queries I've found return (content area + padding) or
> (content area + padding + border). I have found no query whose result is
> influenced by the margin nor any to tell me the padding.
>
> Style queries return empty strings unless a style is actually set on the
> element so are useless for elements having default settings.
>
> Can anyone suggest a way to determine this information?
>
> Regards
>
> -Mark
>

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: