mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-17 16:48:32 +00:00
comment out opacity logic for now
This commit is contained in:
parent
3fc5bb31d0
commit
dacd9afac0
@ -98,17 +98,17 @@ const visibleMiniLocations = StateField.define({
|
|||||||
// this is called every frame to show the locations that are currently active
|
// this is called every frame to show the locations that are currently active
|
||||||
// we can NOT create new marks because the context.locations haven't changed since eval time
|
// we can NOT create new marks because the context.locations haven't changed since eval time
|
||||||
// this is why we need to find a way to update the existing decorations, showing the ones that have an active range
|
// this is why we need to find a way to update the existing decorations, showing the ones that have an active range
|
||||||
|
const haps = new Map();
|
||||||
for (let hap of e.value.haps) {
|
for (let hap of e.value.haps) {
|
||||||
for (let { start, end } of hap.context.locations) {
|
for (let { start, end } of hap.context.locations) {
|
||||||
let id = `${start}:${end}`;
|
let id = `${start}:${end}`;
|
||||||
if (!visible.haps.has(id) || visible.haps.get(id).whole.begin.lt(hap.whole.begin)) {
|
if (!haps.has(id) || haps.get(id).whole.begin.lt(hap.whole.begin)) {
|
||||||
visible.haps.set(id, hap);
|
haps.set(id, hap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visible = { atTime: e.value.atTime, haps: visible.haps };
|
visible = { atTime: e.value.atTime, haps };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +136,7 @@ const miniLocationHighlights = EditorView.decorations.compute([miniLocations, vi
|
|||||||
const color = hap.context.color ?? 'var(--foreground)';
|
const color = hap.context.color ?? 'var(--foreground)';
|
||||||
|
|
||||||
// Get explicit channels for color values
|
// Get explicit channels for color values
|
||||||
|
/*
|
||||||
const swatch = document.createElement('div');
|
const swatch = document.createElement('div');
|
||||||
swatch.style.color = color;
|
swatch.style.color = color;
|
||||||
document.body.appendChild(swatch);
|
document.body.appendChild(swatch);
|
||||||
@ -148,12 +149,14 @@ const miniLocationHighlights = EditorView.decorations.compute([miniLocations, vi
|
|||||||
// Get percentage of event
|
// Get percentage of event
|
||||||
const percent = 1 - (atTime - hap.whole.begin) / hap.whole.duration;
|
const percent = 1 - (atTime - hap.whole.begin) / hap.whole.duration;
|
||||||
channels[3] *= percent;
|
channels[3] *= percent;
|
||||||
|
*/
|
||||||
|
|
||||||
builder.add(
|
builder.add(
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
Decoration.mark({
|
Decoration.mark({
|
||||||
attributes: { style: `outline: solid 2px rgba(${channels.join(', ')})` },
|
// attributes: { style: `outline: solid 2px rgba(${channels.join(', ')})` },
|
||||||
|
attributes: { style: `outline: solid 2px ${color}` },
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user