Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
93ebc9e4
Commit
93ebc9e4
authored
Sep 18, 2015
by
krisgiesing
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1242 from krisgiesing/master
Fix Rect intersection; add test
parents
127cd14b
c52b6fb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
rect_test_disabled.dart
packages/unit/test/engine/rect_test_disabled.dart
+33
-0
No files found.
packages/unit/test/engine/rect_test_disabled.dart
0 → 100644
View file @
93ebc9e4
import
'dart:sky'
;
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
"rect accessors"
,
()
{
Rect
r
=
new
Rect
.
fromLTRB
(
1.0
,
3.0
,
5.0
,
7.0
);
expect
(
r
.
left
,
equals
(
1.0
));
expect
(
r
.
top
,
equals
(
3.0
));
expect
(
r
.
right
,
equals
(
5.0
));
expect
(
r
.
bottom
,
equals
(
7.0
));
});
test
(
"rect created by width and height"
,
()
{
Rect
r
=
new
Rect
.
fromLTWH
(
1.0
,
3.0
,
5.0
,
7.0
);
expect
(
r
.
left
,
equals
(
1.0
));
expect
(
r
.
top
,
equals
(
3.0
));
expect
(
r
.
right
,
equals
(
6.0
));
expect
(
r
.
bottom
,
equals
(
10.0
));
});
test
(
"rect intersection"
,
()
{
Rect
r1
=
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
);
Rect
r2
=
new
Rect
.
fromLTRB
(
50.0
,
50.0
,
200.0
,
200.0
);
Rect
r3
=
r1
.
intersect
(
r2
);
expect
(
r3
.
left
,
equals
(
50.0
));
expect
(
r3
.
top
,
equals
(
50.0
));
expect
(
r3
.
right
,
equals
(
100.0
));
expect
(
r3
.
bottom
,
equals
(
100.0
));
Rect
r4
=
r2
.
intersect
(
r1
);
expect
(
r4
,
equals
(
r3
));
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment