forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEvalIntersect.test
More file actions
44 lines (30 loc) · 879 Bytes
/
Copy pathEvalIntersect.test
File metadata and controls
44 lines (30 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
setup "invalid input"
create image
create image
test-error intersect("not an image", image 2)
teardown
setup
local tAlpha, tBlackImage
repeat with i = 1 to 100
put numToByte(0) after tAlpha[0]
put numToByte(127) after tAlpha[1]
put numToByte(255) after tAlpha[2]
put numToByte(0)&numToByte(0)&numToByte(0)&numToByte(0) after tBlackImage
end repeat
local tImage1, tImage2
create image
put the long id of the last image into tImage1
create image
put the long id of the last image into tImage2
set the rect of tImage1 to 0,0,10,10
set the rect of tImage2 to 0,0,10,10
repeat with i = 0 to 2
set the alphadata of tImage1 to tAlpha[i]
repeat with j = i to 2
set the alphadata of tImage2 to tAlpha[j]
test intersect(tImage1, tImage2)
end repeat
end repeat
set the topleft of tImage2 to the topright of tImage1
test not intersect(tImage1, tImage2)
teardown