Skip to content

Commit 17141f2

Browse files
Param descriptions now repaints on mode changes.
1 parent 45008cc commit 17141f2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/disp/disp_n5.mjs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let Ns5rDisplay = class extends RootDisplay {
2525
#pixelLit = 255;
2626
#pixelOff = 0;
2727
#refreshed = true;
28+
#lastTrue = false;
2829
useBlur = false; // Pixel blur will only activate if this is enabled
2930
xgFont = new MxFont40("./data/bitmaps/xg/font.tsv");
3031
trueFont = new MxFont40("./data/bitmaps/korg/font.tsv", "./data/bitmaps/xg/font.tsv");
@@ -367,6 +368,9 @@ let Ns5rDisplay = class extends RootDisplay {
367368
// Screen buffer write finish.
368369
// Determine if full render is required.
369370
let drawPixMode = false;
371+
if (this.#lastTrue != trueMode) {
372+
this.#refreshed = true;
373+
};
370374
if (this.#refreshed) {
371375
// Full render required.
372376
// Clear all pixels.
@@ -376,13 +380,13 @@ let Ns5rDisplay = class extends RootDisplay {
376380
ctx.font = '11px "Arial Web"';
377381
ctx.fillStyle = "#000e";
378382
ctx.fillText("MIDI. CH", 58, 10);
379-
ctx.fillText("VOL", 153.5, 10);
380-
ctx.fillText("EXP", 231.5, 10);
381-
ctx.fillText("PAN", 322.5, 10);
382-
ctx.fillText("REV", 405, 10);
383-
ctx.fillText("CHO", 484, 10);
384-
ctx.fillText("BRT", 561.5, 10);
385-
ctx.fillText("EFFECT TYPE", 738, 10);
383+
ctx.fillText("VOL", 153.5 + (+trueMode * 12), 10);
384+
ctx.fillText("EXP", 231.5 + (+trueMode * 12), 10);
385+
ctx.fillText("PAN", 322.5 + (+trueMode * 12), 10);
386+
ctx.fillText("REV", 405 + (+trueMode * 18), 10);
387+
ctx.fillText("CHO", 484 + (+trueMode * 18), 10);
388+
!trueMode && ctx.fillText("BRT", 561.5, 10);
389+
ctx.fillText("EFFECT TYPE", 738 - (+trueMode * 18), 10);
386390
ctx.fillText("PART", 34, 262);
387391
let circle = 2 * Math.PI;
388392
for (let c = 1; c < 33; c ++) {
@@ -446,6 +450,7 @@ let Ns5rDisplay = class extends RootDisplay {
446450
this.#omdb[i] = e;
447451
};
448452
});
453+
this.#lastTrue = trueMode;
449454
};
450455
};
451456

0 commit comments

Comments
 (0)