Skip to content

Commit 01f2a58

Browse files
committed
semantics
1 parent db5004e commit 01f2a58

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/svgo/tools.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,12 @@ export const includesUrlReference = (body) => {
193193
};
194194

195195
/**
196-
* Checks if changing the path would cause the element to look different.
196+
* Checks if changing the position or size of an element would
197+
* cause the element to look different.
197198
* @param {import('../types.js').ComputedStyles} computedStyle
198-
* @returns {boolean} If it's safe to change the path.
199+
* @returns {boolean} If it's safe to change the position.
199200
*/
200-
export const canChangePath = (computedStyle) => {
201+
export const canChangePosition = (computedStyle) => {
201202
if (computedStyle['marker-start']) return false;
202203
if (computedStyle['marker-mid']) return false;
203204
if (computedStyle['marker-end']) return false;

plugins/applyTransformsShapes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { collectStylesheet, computeStyle } from '../lib/style.js';
22
import {
33
toFixed,
44
removeLeadingZero,
5-
canChangePath,
5+
canChangePosition,
66
} from '../lib/svgo/tools.js';
77
import { attrsGroupsDefaults } from './_collections.js';
88
import { transform2js, transformsMultiply } from './_transforms.js';

plugins/mergePaths.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { collectStylesheet, computeStyle } from '../lib/style.js';
1111
import { path2js, js2path, intersects } from './_path.js';
12-
import { canChangePath } from '../lib/svgo/tools.js';
12+
import { canChangePosition } from '../lib/svgo/tools.js';
1313

1414
export const name = 'mergePaths';
1515
export const description = 'merges multiple paths in one if possible';
@@ -83,7 +83,7 @@ export const fn = (root, params) => {
8383
}
8484

8585
const computedStyle = computeStyle(stylesheet, child);
86-
if (!canChangePath(computedStyle)) {
86+
if (!canChangePosition(computedStyle)) {
8787
if (prevPathData) {
8888
updatePreviousPath(prevChild, prevPathData);
8989
}

0 commit comments

Comments
 (0)