Results 1 to 10 of 35

Thread: Pascal eXtended Library (aka Asphyre) released!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sphinx304:
    Code:
    function OverlapRect(const Rect1, Rect2: TRect): Boolean;
    begin
       Result:= (Rect1.Left < Rect2.Right) and (Rect1.Right >  Rect2.Left) and (Rect1.Top < Rect2.Bottom) and (Rect1.Bottom > Rect2.Top);
    end;
    PXL:
    Code:
    function OverlapRect(const Rect1, Rect2: TIntRect): Boolean;
    begin
      Result := (Rect2.Left < Rect1.Right) and (Rect2.Right > Rect1.Left) and (Rect2.Top < Rect1.Bottom) and
        (Rect2.Bottom > Rect1.Top);
    end;
    dear LP, It took me two hours to debug the changes...
    Last edited by SilverWarior; 11-11-2015 at 05:55 PM. Reason: Adding code tags

  2. #2
    @devchenxip Please use code tags when posting source code one the forum.

    To do so you might want to switch to advanced post editing by using "Go Advanced" button which also have several buttons for adding code tags. The languages for which code tags are supported by our forums are Object Pascal, HTM; and PHP.

    Also don't use any other type of formatting for source code like Coloring or it breaks the code tags.
    Last edited by SilverWarior; 11-11-2015 at 06:02 PM.

  3. #3
    Quote Originally Posted by SilverWarior View Post
    @devchenxip Please use code tags when posting source code one the forum.

    To do so you might want to switch to advanced post editing by using "Go Advanced" button which also have several buttons for adding code tags. The languages for which code tags are supported by our forums are Object Pascal, HTM; and PHP.

    Also don't use any other type of formatting for source code like Coloring or it breaks the code tags.

    Sorry for the inconvenience!

  4. #4
    devchenxip, thanks for reporting this, but what is the problem?
    (yes, OverlapRect was modified to test Rect2 vs Rect1, previously it was inverted)

    Also, for bugs, it is advisable to post them here.

  5. #5
    Quote Originally Posted by LP View Post
    devchenxip, thanks for reporting this, but what is the problem?
    (yes, OverlapRect was modified to test Rect2 vs Rect1, previously it was inverted)

    Also, for bugs, it is advisable to post them here.
    I didn't expect you will modify the code.


    My old code used in many places this function.


    It took me a lot of time debugging, finally found unexpectedly is "OverlapRect" changed.

    Have a nice weekend.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •