Re: Functions For Helping FillRect

2004-10-25 Thread William Poetra Yoga H
--- Alexandre Julliard <[EMAIL PROTECTED]> wrote: > > And, is my second assumption correct, btw? I mean, > > x = r.right - r.left + 1 > > y = r.bottom - r.top + 1 > > I'm not sure what you mean, it seems you are trying to think too hard > about it; just don't worry about doing +1/-1, that should

Re: Functions For Helping FillRect

2004-10-25 Thread Alexandre Julliard
William Poetra Yoga H <[EMAIL PROTECTED]> writes: > Oh, so: > > r.left = 10; > r.top = 10; > r.right = 60; > r.bottom = 85; > FillRect(hdc, &r, hbr); > >> > And for everything else when we have an x by y rectangle, we actually mean >> > (x-1) by (y-1), is it OK to assume so? Am I correct? >> > >

Re: Functions For Helping FillRect

2004-10-25 Thread William Poetra Yoga H
--- Alexandre Julliard <[EMAIL PROTECTED]> wrote: > William Poetra Yoga H <[EMAIL PROTECTED]> writes: > > > Um... OK, so the correct code is to add 1 to the sides, right? I mean, to > draw > > the 50x75 rectangle we would do: > > > > r.left = 10; > > r.top = 10; > > r.right = 61; > > r.bottom =

Re: Functions For Helping FillRect

2004-10-25 Thread Alexandre Julliard
William Poetra Yoga H <[EMAIL PROTECTED]> writes: > Um... OK, so the correct code is to add 1 to the sides, right? I mean, to draw > the 50x75 rectangle we would do: > > r.left = 10; > r.top = 10; > r.right = 61; > r.bottom = 86; > > FillRect(hdc, &r, hbr); > > And for everything else when we have

Re: Functions For Helping FillRect (Correction)

2004-10-25 Thread William Poetra Yoga H
--- Vincent Béron <[EMAIL PROTECTED]> wrote: > You're passing a struct by value. If you want the caller to have his > structure to be modified, you need to pass it by ref. > > Vincent > No, I don't want the original structure to be modified. I want to return a structure from the function, a st

Re: Functions For Helping FillRect

2004-10-25 Thread William Poetra Yoga H
--- "Dimitrie O. Paun" <[EMAIL PROTECTED]> wrote: > This is OK, the rect functions are consistent with the rest of the GUI > functions > (I would also add that not including the right and bottom borders is a good > thing, > but let's not debate that). Anyway, even if the standard APIs were awkward

Re: Functions For Helping FillRect

2004-10-24 Thread Dimitrie O. Paun
On Sun, Oct 24, 2004 at 02:20:53AM -0700, William Poetra Yoga H wrote: > FillRect is used in many places for drawing the GUI. But one thing I think many > developers miss is that it doesn't fill the right and bottom borders of the > rectangle, very much like LineTo doesn't draw the destination poin

Re: Functions For Helping FillRect (Correction)

2004-10-24 Thread Vincent Béron
Le dim 24/10/2004 à 06:00, William Poetra Yoga H a écrit : [snip] > And I think these two functions suffice. But the question is, why do we have to > make them inline? Why do the contents of r get scrambled up if we don't? You're passing a struct by value. If you want the caller to have his struct

Re: Functions For Helping FillRect (Correction)

2004-10-24 Thread William Poetra Yoga H
Oops, they didn't work... I have to make them inline: inline RECT ToFill(RECT r) { ++r.right; ++r.bottom; return r; } inline LPRECT LPToFill(RECT r) { ++r.right; ++r.bottom; return &r; } And I think these two functions suffice. But the question is, why do we have to make them inlin

Functions For Helping FillRect

2004-10-24 Thread William Poetra Yoga H
FillRect is used in many places for drawing the GUI. But one thing I think many developers miss is that it doesn't fill the right and bottom borders of the rectangle, very much like LineTo doesn't draw the destination point (as per the MSDN docs). But when handling RECT structures we usually think