Merge branch 'main' into versionIndicator
This commit is contained in:
commit
ca1aca0c00
2 changed files with 12 additions and 8 deletions
|
|
@ -444,14 +444,16 @@ export class StrudelMirror {
|
||||||
this.setFontSize(value);
|
this.setFontSize(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setCode(code) {
|
replaceCode(code, from, to) {
|
||||||
const changes = {
|
const changes = { from, to, insert: code };
|
||||||
from: 0,
|
|
||||||
to: this.editor.state.doc.length,
|
|
||||||
insert: code,
|
|
||||||
};
|
|
||||||
this.editor.dispatch({ changes });
|
this.editor.dispatch({ changes });
|
||||||
}
|
}
|
||||||
|
insertCode(code, position) {
|
||||||
|
this.replaceCode(code, position, position);
|
||||||
|
}
|
||||||
|
setCode(code) {
|
||||||
|
this.replaceCode(code, 0, this.editor.state.doc.length);
|
||||||
|
}
|
||||||
// used for debugging but could serve other purposes
|
// used for debugging but could serve other purposes
|
||||||
getActiveWidgets() {
|
getActiveWidgets() {
|
||||||
return getActiveWidgets(this.editor);
|
return getActiveWidgets(this.editor);
|
||||||
|
|
|
||||||
|
|
@ -485,8 +485,10 @@ export function waveformN(partials, phases, type) {
|
||||||
if (phase !== 0) {
|
if (phase !== 0) {
|
||||||
const c = Math.cos(PI2 * phase);
|
const c = Math.cos(PI2 * phase);
|
||||||
const s = Math.sin(PI2 * phase);
|
const s = Math.sin(PI2 * phase);
|
||||||
R = c * R - s * I;
|
const R0 = R;
|
||||||
I = s * R + c * I;
|
const I0 = I;
|
||||||
|
R = c * R0 - s * I0;
|
||||||
|
I = s * R0 + c * I0;
|
||||||
}
|
}
|
||||||
real[n + 1] = R;
|
real[n + 1] = R;
|
||||||
imag[n + 1] = I;
|
imag[n + 1] = I;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue