浏览代码

Bug Fix: Need to exclude the last margin to measure the correct carousel width.

Naotoshi Fujita 2 年之前
父节点
当前提交
f758da563b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/js/components/Layout/Layout.ts

+ 1 - 1
src/js/components/Layout/Layout.ts

@@ -222,7 +222,7 @@ export function Layout( Splide: Splide, Components: Components, options: Options
    * @return The width or height of the slider without clones.
    */
   function sliderSize(): number {
-    return totalSize( Splide.length - 1 ) - totalSize( 0 ) + slideSize( 0 );
+    return totalSize( Splide.length - 1, true ) - totalSize( 0, true ) + slideSize( 0, true );
   }
 
   /**