Skip to content

Commit

Permalink
Add option to make stickTo use either 0 or previous transpose value (#17
Browse files Browse the repository at this point in the history
)

* Add option to make stickTo use either 0 or previous transpose value (sticky auto-transposition)

* Minor bug fix, no longer toggling resilience if sticky auto-transposition text is clicked
  • Loading branch information
Albacusphetical authored Aug 11, 2024
1 parent cb5e8aa commit 2174c52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
}
let autoRegion = (left, right, opts = undefined) => {
let stickTo = opts?.stickTo
let stickTo = settings.stickyAutoTransposition ? opts?.stickTo : 0
let skipSave = opts?.skipSave ?? false
let ignorePrevious = opts?.ignorePrevious ?? false
Expand Down Expand Up @@ -389,7 +389,7 @@
for (let region of regions) {
// console.log('transposing region', region.left, region.right)
let best = autoRegion(region.left, region.right, {
stickTo: previous_transposition,
stickTo: previous_transposition,
skipSave: true,
})
previous_transposition = best
Expand Down
7 changes: 7 additions & 0 deletions src/components/SheetOptions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
minSpeedChange: 10,
oorSeparator: ':',
resilience: 2,
stickyAutoTransposition: false,
font: fonts[0],
lineHeight: 135,
capturingImage: false,
Expand All @@ -46,6 +47,12 @@
<input class="w-32" id="atleast" type="range" min=0 max=12 bind:value={settings.resilience}>
<span style="display:flex; align-items: center">{settings.resilience}</span>
</div>
<div class="flex flex-row mt-3">
<label class="flex flex-row items-center"
title="Defines whether or not the transposed region(s) should be related to previous regions"
for="sticky-auto-transposition">Sticky auto-transposition (?):</label>
<input class="mx-1" type='checkbox' id="sticky-auto-transposition" bind:checked={settings.stickyAutoTransposition}>
</div>
</div>

<hr class="my-2 mx-1">
Expand Down

0 comments on commit 2174c52

Please sign in to comment.