Sprity’s gulp Plugin margin Setup Problem?

  node.js, question

Plug-in address:sprites

gulp.task('sprites', function() {
 return sprity.src({
 src: './src/images/icon/**/*.{png,jpg}',
 style: './_icon.scss',
 margin: 20,
 orientation: 'left-right',
 processor: 'css',
 })
 .pipe(gulpif('*.png', gulp.dest('./src/images/'), gulp.dest('./src/sass/')))
 });

图片描述

The background-position position generated by configuring margin: 20 will be inaccurate, and setting margin: 0 will be normal.

{{#each layouts}}
 {{#each sprites}}
 
 {{#if dpi}}
 @media (-webkit-min-device-pixel-ratio: {{ratio}}), (min-resolution: {{dpi}}dpi) {
 {{/if}}
 .icon {
 background-image: url('{{escimage url}}');
 {{#if dpi}}
 background-size: {{width}} {{height}};
 {{/if}}
 bracket
 {{#if dpi}}
 bracket
 {{/if}}
 {{/each}}
 
 {{#each layout.items}}
 .{{../classname}}-{{meta.name}} {
 background-position: (-{{x}}px - 20) (-{{y}}px - 20);
 width: ({{width}}px - 40);
 height: ({{height}}px - 40);
 bracket
 {{/each}}
 {{/each}}

It is normal to add this. hbs template