Skip to content

Commit 56ea25f

Browse files
author
Divyanshi Vashist
committed
Resolved merge conflicts
1 parent 8c0b3e2 commit 56ea25f

File tree

2 files changed

+39
-40
lines changed

2 files changed

+39
-40
lines changed

src/offsetPath.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
return Math.round(number * 100) / 100;
99
}
1010

11-
function basicShapePolygonParse (input) {
11+
function basicShapePolygonParse (input, element) {
1212
// TODO: Support the fill-rule option and %
1313
var argumentList = input.split(',');
1414
var coordinate = null;

test/pathBasicShapeCircleTest.js

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,97 @@
11
/* global assert suite test internalScope */
22

3-
43
(function () {
54
suite('offsetPath', function () {
65
test('basicShapeCircle', function () {
7-
var assertTransformInterpolation = internalScope.assertTransformInterpolation;
8-
var offsetPathParse = internalScope.offsetPathParse;
6+
var assertTransformInterpolation = internalScope.assertTransformInterpolation;
7+
var offsetPathParse = internalScope.offsetPathParse;
98

10-
var containerStyle = {
9+
var containerStyle = {
1110
position: 'absolute',
1211
height: '100px',
1312
width: '200px'
14-
};
13+
};
1514

16-
var container = document.createElement('div');
15+
var container = document.createElement('div');
1716

18-
for (var property in containerStyle) {
17+
for (var property in containerStyle) {
1918
container.style[property] = containerStyle[property];
20-
}
19+
}
2120

22-
var target = document.createElement('div');
23-
container.appendChild(target);
24-
document.body.appendChild(container);
21+
var target = document.createElement('div');
22+
container.appendChild(target);
23+
document.body.appendChild(container);
2524

26-
var circlePathString = offsetPathParse('circle(50%)', target).path;
27-
assert.equal(circlePathString, 'M 100 50 m 0,-79.06 a 79.06,79.06 0 0,1 79.06,79.06 a 79.06,79.06 0 1,1 -79.06,-79.06 z');
25+
var circlePathString = offsetPathParse('circle(50%)', target).path;
26+
assert.equal(circlePathString, 'M 100 50 m 0,-79.06 a 79.06,79.06 0 0,1 79.06,79.06 a 79.06,79.06 0 1,1 -79.06,-79.06 z');
2827

29-
circlePathString = offsetPathParse('circle(10px)', target).path;
30-
assert.equal(circlePathString, 'M 100 50 m 0,-10 a 10,10 0 0,1 10,10 a 10,10 0 1,1 -10,-10 z');
28+
circlePathString = offsetPathParse('circle(10px)', target).path;
29+
assert.equal(circlePathString, 'M 100 50 m 0,-10 a 10,10 0 0,1 10,10 a 10,10 0 1,1 -10,-10 z');
3130

32-
circlePathString = offsetPathParse('circle(10px at 50%)', target).path;
33-
assert.equal(circlePathString, 'M 100 50 m 0,-10 a 10,10 0 0,1 10,10 a 10,10 0 1,1 -10,-10 z');
31+
circlePathString = offsetPathParse('circle(10px at 50%)', target).path;
32+
assert.equal(circlePathString, 'M 100 50 m 0,-10 a 10,10 0 0,1 10,10 a 10,10 0 1,1 -10,-10 z');
3433

35-
circlePathString = offsetPathParse('circle(50% at 100px 200px)', target).path;
36-
assert.equal(circlePathString, 'M 100 200 m 0,-79.06 a 79.06,79.06 0 0,1 79.06,79.06 a 79.06,79.06 0 1,1 -79.06,-79.06 z');
34+
circlePathString = offsetPathParse('circle(50% at 100px 200px)', target).path;
35+
assert.equal(circlePathString, 'M 100 200 m 0,-79.06 a 79.06,79.06 0 0,1 79.06,79.06 a 79.06,79.06 0 1,1 -79.06,-79.06 z');
3736

38-
circlePathString = offsetPathParse('circle(10px at 50% 50%)', target).path;
39-
assert.equal(circlePathString, 'M 100 50 m 0,-10 a 10,10 0 0,1 10,10 a 10,10 0 1,1 -10,-10 z');
37+
circlePathString = offsetPathParse('circle(10px at 50% 50%)', target).path;
38+
assert.equal(circlePathString, 'M 100 50 m 0,-10 a 10,10 0 0,1 10,10 a 10,10 0 1,1 -10,-10 z');
4039

41-
assertTransformInterpolation([
40+
assertTransformInterpolation([
4241
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '0%'},
4342
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '100%'}],
44-
[
43+
[
4544
{at: 0, is: 'translate3d(0px, -10px, 0px)'},
4645
{at: 0.25, is: 'translate3d(10px, 0px, 0px) rotate(90deg)'},
4746
{at: 0.5, is: 'translate3d(0px, 10px, 0px) rotate(180deg)'},
4847
{at: 0.75, is: 'translate3d(-10px, 0px, 0px) rotate(-90deg)'},
4948
{at: 1, is: 'translate3d(0px, -10px, 0px)'}
50-
]
49+
]
5150
);
5251

53-
assertTransformInterpolation([
52+
assertTransformInterpolation([
5453
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '0px'},
5554
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '62.83px'}],
56-
[
55+
[
5756
{at: 0, is: 'translate3d(0px, -10px, 0px)'},
5857
{at: 0.25, is: 'translate3d(10px, 0px, 0px) rotate(89.45deg)'},
5958
{at: 0.5, is: 'translate3d(0.01px, 10px, 0px) rotate(180deg)'},
6059
{at: 0.75, is: 'translate3d(-10px, 0.01px, 0px) rotate(-90deg)'},
6160
{at: 1, is: 'translate3d(-0.01px, -10px, 0px) rotate(-0.55deg)'}
62-
]
61+
]
6362
);
6463

65-
assertTransformInterpolation([
64+
assertTransformInterpolation([
6665
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '0%'},
6766
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '50%'}],
68-
[
67+
[
6968
{at: 0, is: 'translate3d(0px, -10px, 0px)'},
7069
{at: 0.5, is: 'translate3d(10px, 0px, 0px) rotate(90deg)'},
7170
{at: 1, is: 'translate3d(0px, 10px, 0px) rotate(180deg)'}
72-
]
71+
]
7372
);
7473

75-
assertTransformInterpolation([
74+
assertTransformInterpolation([
7675
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '0px'},
7776
{'offsetPath': 'circle(10px at 0px 0px)', 'offsetDistance': '31.42px'}],
78-
[
77+
[
7978
{at: 0, is: 'translate3d(0px, -10px, 0px)'},
8079
{at: 0.5, is: 'translate3d(10px, 0px, 0px) rotate(90deg)'},
8180
{at: 1, is: 'translate3d(0px, 10px, 0px) rotate(179.45deg)'}
82-
]
81+
]
8382
);
8483

85-
assertTransformInterpolation([
84+
assertTransformInterpolation([
8685
{'offsetPath': 'circle(10px at 100px 100px)', 'offsetDistance': '0%'},
8786
{'offsetPath': 'circle(10px at 100px 100px)', 'offsetDistance': '100%'}],
88-
[
87+
[
8988
{at: 0, is: 'translate3d(100px, 90px, 0px)'},
9089
{at: 0.25, is: 'translate3d(110px, 100px, 0px) rotate(90deg)'},
9190
{at: 0.5, is: 'translate3d(100px, 110px, 0px) rotate(180deg)'},
9291
{at: 0.75, is: 'translate3d(90px, 100px, 0px) rotate(-90deg)'},
9392
{at: 1, is: 'translate3d(100px, 90px, 0px)'}
94-
]
93+
]
9594
);
96-
});
97-
});
98-
})();
95+
});
96+
});
97+
})();

0 commit comments

Comments
 (0)