Browse Source

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

Naotoshi Fujita 2 năm trước cách đây
mục cha
commit
f758da563b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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 );
   }
 
   /**