I’m reading a 3-d party Delphi sources and stuck with a line, where Rect is initialized with another Rect’s coordinates, but swapped, like this:
r, rsrc: TRect;
...
r := Rect(rsrc.right + 1, rsrc.bottom + 1, rsrc.left, rsrc.top);
rsrc is filled with proper on-screen coordinates, so (left,top) is always less than (right,bottom).
What does this mean? I can’t find any mentions of possible purpose for this in the Delphi documentation.
It doesn’t mean anything, just as
SomeVarName := 7doesn’t mean anything on it’s own. Look further down into the code and see what theris supposed to be used for; Also look for howrsrcwas obtained.It might simply be that the coordinates for
rsrcwere obtained using some math and it was determined that the resulting rectangle is up side down, hence the code rotates the rectangle to be top-side-up.