diff --git a/src/rendering/staves/BarLayoutingInfo.ts b/src/rendering/staves/BarLayoutingInfo.ts index 1052f01c1..4240b13b9 100644 --- a/src/rendering/staves/BarLayoutingInfo.ts +++ b/src/rendering/staves/BarLayoutingInfo.ts @@ -260,6 +260,9 @@ export class BarLayoutingInfo { } public spaceToForce(space: number): number { + if(this._timeSortedSprings.length > 0) { + space -= this._timeSortedSprings[0].preSpringWidth + } return space * this.totalSpringConstant; } diff --git a/test-data/visual-tests/effects-and-annotations/bends.png b/test-data/visual-tests/effects-and-annotations/bends.png index 8dd064372..8fcdb9441 100644 Binary files a/test-data/visual-tests/effects-and-annotations/bends.png and b/test-data/visual-tests/effects-and-annotations/bends.png differ diff --git a/test-data/visual-tests/effects-and-annotations/fingering.png b/test-data/visual-tests/effects-and-annotations/fingering.png index e65ee437f..c76e1d555 100644 Binary files a/test-data/visual-tests/effects-and-annotations/fingering.png and b/test-data/visual-tests/effects-and-annotations/fingering.png differ diff --git a/test-data/visual-tests/effects-and-annotations/tremolo-bar.png b/test-data/visual-tests/effects-and-annotations/tremolo-bar.png index 67bde0402..fbba39c68 100644 Binary files a/test-data/visual-tests/effects-and-annotations/tremolo-bar.png and b/test-data/visual-tests/effects-and-annotations/tremolo-bar.png differ diff --git a/test-data/visual-tests/effects-and-annotations/triplet-feel.png b/test-data/visual-tests/effects-and-annotations/triplet-feel.png index daab0fa4b..30aae89b2 100644 Binary files a/test-data/visual-tests/effects-and-annotations/triplet-feel.png and b/test-data/visual-tests/effects-and-annotations/triplet-feel.png differ diff --git a/test-data/visual-tests/effects-and-annotations/tuplets-advanced.png b/test-data/visual-tests/effects-and-annotations/tuplets-advanced.png index 5ac0cdc81..832d43665 100644 Binary files a/test-data/visual-tests/effects-and-annotations/tuplets-advanced.png and b/test-data/visual-tests/effects-and-annotations/tuplets-advanced.png differ diff --git a/test-data/visual-tests/guitar-tabs/string-variations.png b/test-data/visual-tests/guitar-tabs/string-variations.png index 01d7378f6..c5247fa6f 100644 Binary files a/test-data/visual-tests/guitar-tabs/string-variations.png and b/test-data/visual-tests/guitar-tabs/string-variations.png differ diff --git a/test-data/visual-tests/layout/multi-track.png b/test-data/visual-tests/layout/multi-track.png index 8593b5bbb..2eb5e073c 100644 Binary files a/test-data/visual-tests/layout/multi-track.png and b/test-data/visual-tests/layout/multi-track.png differ diff --git a/test-data/visual-tests/layout/multi-voice.png b/test-data/visual-tests/layout/multi-voice.png index a8aba7806..46f6709b0 100644 Binary files a/test-data/visual-tests/layout/multi-voice.png and b/test-data/visual-tests/layout/multi-voice.png differ diff --git a/test-data/visual-tests/layout/page-layout-5barsperrow.png b/test-data/visual-tests/layout/page-layout-5barsperrow.png index ed54859d2..051c20e85 100644 Binary files a/test-data/visual-tests/layout/page-layout-5barsperrow.png and b/test-data/visual-tests/layout/page-layout-5barsperrow.png differ diff --git a/test-data/visual-tests/layout/page-layout.png b/test-data/visual-tests/layout/page-layout.png index 63b1c981a..29aade2b4 100644 Binary files a/test-data/visual-tests/layout/page-layout.png and b/test-data/visual-tests/layout/page-layout.png differ diff --git a/test-data/visual-tests/music-notation/key-signatures.png b/test-data/visual-tests/music-notation/key-signatures.png index b05a6a232..2b1b09533 100644 Binary files a/test-data/visual-tests/music-notation/key-signatures.png and b/test-data/visual-tests/music-notation/key-signatures.png differ diff --git a/test-data/visual-tests/music-notation/notes-rests-beams.png b/test-data/visual-tests/music-notation/notes-rests-beams.png index 602a1a4e0..0bb689b9b 100644 Binary files a/test-data/visual-tests/music-notation/notes-rests-beams.png and b/test-data/visual-tests/music-notation/notes-rests-beams.png differ diff --git a/test-data/visual-tests/special-tracks/drum-tabs.png b/test-data/visual-tests/special-tracks/drum-tabs.png index 90246bbf7..3b7da2a37 100644 Binary files a/test-data/visual-tests/special-tracks/drum-tabs.png and b/test-data/visual-tests/special-tracks/drum-tabs.png differ diff --git a/test-data/visual-tests/special-tracks/grand-staff.png b/test-data/visual-tests/special-tracks/grand-staff.png index c45fbef0d..c14b54732 100644 Binary files a/test-data/visual-tests/special-tracks/grand-staff.png and b/test-data/visual-tests/special-tracks/grand-staff.png differ diff --git a/test/visualTests/VisualTestHelper.ts b/test/visualTests/VisualTestHelper.ts index 1314a5f5c..8a18ad725 100644 --- a/test/visualTests/VisualTestHelper.ts +++ b/test/visualTests/VisualTestHelper.ts @@ -76,8 +76,7 @@ export class VisualTestHelper { let referenceFileData: Uint8Array; try { referenceFileData = await TestPlatform.loadFile(`test-data/visual-tests/${referenceFileName}`); - } - catch (e) { + } catch (e) { referenceFileData = new Uint8Array(0); } @@ -391,8 +390,10 @@ export class VisualTestHelper { const width = Math.max(exCanvas.width, acCanvas.width); const height = Math.max(exCanvas.height, acCanvas.height); + const controlsHeight = 60; + el.style.width = width + 'px'; - el.style.height = height + 60 + 'px'; + el.style.height = height + controlsHeight + 'px'; el.style.position = 'relative'; ex.style.width = width + 'px'; @@ -400,27 +401,27 @@ export class VisualTestHelper { ex.style.background = '#FFF'; ex.style.position = 'absolute'; ex.style.left = '0'; - ex.style.top = '0'; + ex.style.top = controlsHeight + 'px'; ac.style.width = width / 2 + 'px'; ac.style.height = height + 'px'; ac.style.background = '#FFF'; ac.style.position = 'absolute'; ac.style.right = '0'; - ac.style.top = '0'; + ac.style.top = controlsHeight + 'px'; ac.style.boxShadow = '-7px 0 10px -5px rgba(0,0,0,.5)'; ac.style.overflow = 'hidden'; acCanvas.style.position = 'absolute'; acCanvas.style.right = '0'; acCanvas.style.top = '0'; - df.style.display = "none"; + df.style.display = 'none'; df.style.width = width + 'px'; df.style.height = height + 'px'; df.style.background = '#FFF'; df.style.position = 'absolute'; df.style.left = '0'; - df.style.top = '0'; + df.style.top = controlsHeight + 'px'; const slider = document.createElement('input'); slider.type = 'range'; @@ -429,7 +430,7 @@ export class VisualTestHelper { slider.step = '0.001'; slider.value = '0.5'; slider.style.position = 'absolute'; - slider.style.bottom = '30px'; + slider.style.top = '30px'; slider.style.right = '0'; slider.style.left = '0'; slider.style.width = '100%'; @@ -439,9 +440,9 @@ export class VisualTestHelper { el.appendChild(slider); const diffToggleLabel = document.createElement('label'); - diffToggleLabel.style.position = "absolute"; - diffToggleLabel.style.left = "0"; - diffToggleLabel.style.bottom = "0"; + diffToggleLabel.style.position = 'absolute'; + diffToggleLabel.style.left = '0'; + diffToggleLabel.style.top = '0'; const diffToggle = document.createElement('input'); diffToggle.type = 'checkbox'; @@ -504,7 +505,7 @@ export class VisualTestHelper { oldName = oldName.substr(i + 1); } - if(part.length > 0) { + if (part.length > 0) { part = `-${part}`; }