Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (((tchk1.y <= rect1.y) and (tchk1.y >= rect2.y) and
- (tchk2.y >= rect2.y) and (tchk2.y <= rect1.y)) or
- ((tchk1.y >= rect1.y) and (tchk1.y <= rect2.y) and
- (tchk2.y <= rect2.y) and (tchk2.y >= rect1.y))) then
- begin
- cross1.y := tchk1.y;
- cross1.x := tchk1.x;
- cross2.y := tchk2.y;
- cross2.x := tchk2.x;
- cross1.existance := true;
- cross2.existance := true;
- end;
- if ((tchk1.y <= rect1.y) and (tchk1.y >= rect2.y) and
- (tchk2.y <= rect2.y)) or ((tchk1.y >= rect1.y) and
- (tchk1.y <= rect2.y) and (tchk2.y >= rect2.y)) then
- begin
- cross1.y := rect2.y;
- cross1.x := rect2.x;
- cross2.y := tchk1.y;
- cross2.x := tchk1.x;
- cross1.existance := true;
- cross2.existance := true;
- end;
- if ((tchk2.y <= rect1.y) and (tchk2.y >= rect2.y) and
- (tchk1.y >= rect1.y)) or ((tchk2.y >= rect1.y) and
- (tchk2.y <= rect2.y) and (tchk1.y <= rect1.y)) then
- begin
- cross1.y := tchk2.y;
- cross1.x := tchk2.x;
- cross2.y := rect1.y;
- cross2.x := rect1.x;
- cross1.existance := true;
- cross2.existance := true;
- end;
- if ((tchk2.y >= rect1.y) and (tchk2.y <= rect2.y) and
- (tchk1.y >= rect2.y)) or ((tchk2.y <= rect1.y) and
- (tchk2.y >= rect2.y) and (tchk1.y <= rect2.y)) then
- begin
- cross1.y := rect2.y;
- cross1.x := rect2.x;
- cross2.y := tchk2.y;
- cross2.x := tchk2.x;
- cross1.existance := true;
- cross2.existance := true;
- end;
- if ((tchk1.y <= rect1.y) and (tchk1.y >= rect2.y) and
- (tchk2.y >= rect1.y)) or ((tchk1.y >= rect1.y) and
- (tchk1.y <= rect2.y) and (tchk2.y <= rect1.y)) then
- begin
- cross1.y := rect1.y;
- cross1.x := rect1.x;
- cross2.y := tchk1.y;
- cross2.x := tchk1.x;
- cross1.existance := true;
- cross2.existance := true;
- end;
- if ((tchk1.y >= rect1.y) and (tchk2.y <= rect2.y) and (rect1.y > rect2.y))
- or ((tchk1.y >= rect2.y) and (tchk2.y <= rect1.y) and (rect1.y < rect2.y))
- or ((tchk1.y <= rect2.y) and (tchk2.y >= rect1.y) and (rect1.y > rect2.y))
- or ((tchk1.y <= rect1.y) and (tchk2.y >= rect2.y) and (rect1.y < rect2.y))
- then
- begin
- cross1.y := rect1.y;
- cross1.x := rect1.x;
- cross2.y := rect2.y;
- cross2.x := rect2.x;
- cross1.existance := true;
- cross2.existance := true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement