Ok, I see. Then we have two issues:

#1. getElementDimensions() and setElementDimensions() isn't currently
a logical pair, since border and padding is included in
getElementDimensions but not in setElementDimensions. This is
confusing and should be better documented:

    http://trac.mochikit.com/ticket/310

# 2. I think the current function names can be a cause of confusion
(hence my previous question). And perhaps a single function returning
a Dimensions object would be more in line with existing MochiKit code?
See also the following Trac ticket for other related add-ons to
MochiKit.Style:

    http://trac.mochikit.com/ticket/84
    http://trac.mochikit.com/wiki/MochiKitStyleExtensions

Perhaps a solution would be to change getElementDimensions() to return
an object containing also the CSS width and height? I.e. { w, h, cssW,
cssH }

We should probably take a look at how other toolkits (Prototype, Dojo,
etc) have handled this issue. Might give a few good ideas for creating
a concise and useful API.

Cheers,

/Per

On Tue, May 27, 2008 at 3:25 PM, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
>
> Per Cederberg schrieb:
>> Question though, why add MochiKit.Style.getElementHeight and
>> getElementWidth? I think MochiKit.Style.getElementDimensions was
>> introduced to have one function instead of two (keeping down the size
>> of the API). But now we have three, which seems redundant to me.
>
> getElementDimensions returns the dimensions including padding and
> border, while getElementHeight/Width returns the actual height and
> width. The problem was that the visual effects calculated the original
> width and height using getElementDimensions which was too big.
>
> I could have put getElementHeight/Width in Visual, but Style seemed more
> appropriate. Probably we should add documentation and tests for these?
>
> -- Christoph
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to