Skip to content

Commit

Permalink
fix _subShapes
Browse files Browse the repository at this point in the history
  • Loading branch information
akira-cn committed Sep 1, 2017
1 parent 9a4b5c0 commit fad8418
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions dist/pasition.js
Expand Up @@ -248,10 +248,10 @@ function parse(path) {
var data = [];
path.replace(segment, function (_, command, args) {
var type = command.toLowerCase();
args = parseValues(args
args = parseValues(args);

// overloaded moveTo
);if (type == 'm' && args.length > 2) {
if (type == 'm' && args.length > 2) {
data.push([command].concat(args.splice(0, 2)));
type = 'l';
command = command == 'm' ? 'l' : 'L';
Expand Down Expand Up @@ -750,17 +750,17 @@ pasition._upShapes = function (shapes, count) {
}
};

pasition._subShapes = function (pathA, pathB, count) {
pasition._subShapes = function (shapes, count) {
var _loop2 = function _loop2(i) {
var shape = pathB[pathB.length - 1];
var shape = shapes[shapes.length - 1];
var newShape = [];
var x = shape[0][0],
y = shape[0][1];
shape.forEach(function () {
newShape.push([x, y, x, y, x, y, x, y]);
});

pathB.push(newShape);
shapes.push(newShape);
};

for (var i = 0; i < count; i++) {
Expand All @@ -782,7 +782,7 @@ pasition._preprocessing = function (pathA, pathB) {
clonePathB = JSON.parse(JSON.stringify(pathB));

if (lenA > lenB) {
pasition._subShapes(clonePathA, clonePathB, lenA - lenB);
pasition._subShapes(clonePathB, lenA - lenB);
} else if (lenA < lenB) {
pasition._upShapes(clonePathA, lenB - lenA);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/pasition.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fad8418

Please sign in to comment.