Hi all, I don't know if this has been discussed before, but here goes anyways.
I was looking to implement some vector operations on the Coordinates prototype, such as add/subtract, multiply by factor. If these were to be used more in, say, code that generates SVG graphics and <canvas> stuff - I would think adding rotate and a generat matrix transformation would be appropriate. The thing is that much of this would apply to Dimension objects as well. Take the example of centering something. The object's and container's size would be dimensions, but we need a Coordinates object calculated like this: (containerSize - objSize)/2 Shouldn't these two really be just a single prototype? Currently theire just holders for x,y and w,h properties - but adding some methods would certainly in most cases apply to both classes. However, since js doesn't have a __getattr__ I can't see a way to do this while being backwards compatible. Or maybe I'm the only one who sees a need to add any operations on those classes? Arnar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
