mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Adjust VN mode width overlap calculations
This commit is contained in:
		@@ -192,8 +192,10 @@ async function visualNovelUpdateLayers(container) {
 | 
			
		||||
    let currentPosition = pivotalPoint - (totalWidth / 2);
 | 
			
		||||
 | 
			
		||||
    if (totalWidth > containerWidth) {
 | 
			
		||||
        let overlap = (totalWidth - containerWidth) / (imagesWidth.length - 1);
 | 
			
		||||
        imagesWidth = imagesWidth.map((width) => width - overlap);
 | 
			
		||||
        let totalOverlap = totalWidth - containerWidth;
 | 
			
		||||
        let totalWidthWithoutWidest = imagesWidth.reduce((a, b) => a + b, 0) - Math.max(...imagesWidth);
 | 
			
		||||
        let overlaps = imagesWidth.map(width => (width / totalWidthWithoutWidest) * totalOverlap);
 | 
			
		||||
        imagesWidth = imagesWidth.map((width, index) => width - overlaps[index]);
 | 
			
		||||
        currentPosition = 0; // Reset the initial position to 0
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,6 +15,7 @@
 | 
			
		||||
    height: calc(100vh - 40px);
 | 
			
		||||
    width: 100vw;
 | 
			
		||||
    position: relative;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#visual-novel-wrapper  .expression-holder {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user