From: Henrik I. <he...@is...> - 2004-01-12 17:35:28
|
> I have noticed that IPoint and IRect classes have appeared in > the Syllable API. What is their purpose? Are they going to > replace the older float-based versions? They have been there all the time. :o) I'm not sure of the reason for these float-based Rects, but I suppose Kurt chose them because it made the layout classes simpler to implement... Is there any real reason why we should replace them with integer versions? > The behaviour of Rect and IRect's Width() and Height() > methods do not act as expected. eg. > > Rect cRect(0, 0, 299, 299); > View cAView (cRect, "AView"); > > This view is 300 x 300 pixels. Yet: > > cRect.Width() = 299 > cRect.Height() = 299 > > In a pixel oriented world this is just incorrect, and will > catch out unwary programmers like me. (Although if these were > real world measurements this answer would be correct). > > Should this behaviour be changed? If not, there should at > least be a note about it in the API documentation. To me it > seems very counter-intuitive in a pixel oriented world. > > Thoughts? Very true. (it is very confusing) :o) I don't think we should change this (after all, it is correct)... Maybe a PixelWidth()/Height() method would be a good idea? --- Kind Regards, Henrik Isaksson |