mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Tests helpers: add compareSegmentPoints function.
This commit is contained in:
parent
667992e9f0
commit
0fdfd0033f
1 changed files with 15 additions and 0 deletions
|
@ -193,6 +193,21 @@ function compareParagraphStyles(paragraphStyle, paragraphStyle2, checkIdentity)
|
|||
});
|
||||
}
|
||||
|
||||
function compareSegmentPoints(segmentPoint, segmentPoint2, checkIdentity) {
|
||||
if (checkIdentity) {
|
||||
equals(function() {
|
||||
return segmentPoint !== segmentPoint2;
|
||||
}, true);
|
||||
}
|
||||
var keys = ['selected', 'x', 'y'];
|
||||
for (var i = 0, l = keys.length; i < l; i++) {
|
||||
var key = keys[i];
|
||||
equals(function() {
|
||||
return segmentPoint[key] == segmentPoint2[key];
|
||||
}, true, 'Compare SegmentPoint#' + key);
|
||||
}
|
||||
}
|
||||
|
||||
function compareSegments(segment, segment2, checkIdentity) {
|
||||
var keys = ['handleIn', 'handleOut', 'point'];
|
||||
if (checkIdentity) {
|
||||
|
|
Loading…
Reference in a new issue