@@ -36,7 +36,7 @@ function observable_part_data () {
36
36
partname: { getter: c => this.part.get_name(), notify: n => this.part.on ("notify:uname", n), },
37
37
lasttick: { getter: c => this.part.get_last_tick(), notify: n => this.part.on ("notify:last_tick", n), },
38
38
allnotes: { default: [], notify: n => this.part.on ("noteschanged", n),
39
- getter: c => this.part.list_notes_crossing (0, CONFIG.MAXINT), },
39
+ getter: async c => Object.freeze (await this.part.list_notes_crossing (0, CONFIG.MAXINT) ), },
40
40
};
41
41
return this.observable_from_getters (data, () => this.part);
42
42
}
@@ -69,10 +69,10 @@ module.exports = {
69
69
function render_canvas () {
70
70
// canvas setup
71
71
const canvas = this.$refs['canvas'];
72
- Util.resize_canvas (canvas, canvas.clientWidth, canvas.clientHeight, true);
72
+ const pixelratio = Util.resize_canvas (canvas, canvas.clientWidth, canvas.clientHeight, true);
73
73
const ctx = canvas.getContext ('2d'), cstyle = getComputedStyle (canvas), csp = cstyle.getPropertyValue.bind (cstyle);
74
74
const width = canvas.width, height = canvas.height;
75
- const tickscale = this.tickscale * window.devicePixelRatio ;
75
+ const tickscale = this.tickscale * pixelratio ;
76
76
//const width = canvas.clientWidth, height = canvas.clientHeight;
77
77
//canvas.width = width; canvas.height = height;
78
78
ctx.clearRect (0, 0, width, height);
@@ -102,7 +102,7 @@ function render_canvas () {
102
102
const noteoffset = 12;
103
103
const notescale = height / (123.0 - 2 * noteoffset); // MAX_NOTE
104
104
for (const note of pnotes) {
105
- ctx.fillRect (note.tick * tickscale, height - (note.note - noteoffset) * notescale, note.duration * tickscale, 1 * window.devicePixelRatio );
105
+ ctx.fillRect (note.tick * tickscale, height - (note.note - noteoffset) * notescale, note.duration * tickscale, 1 * pixelratio );
106
106
}
107
107
}
108
108
0 commit comments