1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-10 21:29:33 +00:00

verilog: black border around values in scope, allow zoom out to 1/16 scale

This commit is contained in:
Steven Hugg 2020-09-17 13:22:22 -05:00
parent 11bdd3cf63
commit ae31f8308f
2 changed files with 7 additions and 20 deletions

View File

@ -165,7 +165,7 @@ export class WaveformView {
}
setZoom(zoom : number) {
this.zoom = Math.max(1, Math.min(64, zoom));
this.zoom = Math.max(1/16, Math.min(64, zoom));
this.clocksPerPage = Math.ceil(this.pageWidth/this.zoom); // TODO: refactor into other one
this.refresh();
}
@ -241,7 +241,12 @@ export class WaveformView {
ctx.textAlign = 'right';
if (val !== undefined) {
var s = val.toString(radix);
ctx.fillText(s, w-fh, ycen);
var x = w-fh;
var dims = ctx.measureText(s);
ctx.fillStyle = 'black';
ctx.fillRect(x-dims.width-2, ycen-13, dims.width+4, 17);
ctx.fillStyle = "#ff66ff";
ctx.fillText(s, x, ycen);
}
}
// draw labels

View File

@ -323,24 +323,6 @@ var VerilogPlatform = function(mainElement, options) {
debugCond = null;
}
function shadowText(ctx, txt, x, y) {
ctx.shadowColor = "black";
ctx.shadowBlur = 0;
ctx.shadowOffsetY = -1;
ctx.shadowOffsetX = 0;
ctx.fillText(txt, x, y);
ctx.shadowOffsetY = 1;
ctx.shadowOffsetX = 0;
ctx.fillText(txt, x, y);
ctx.shadowOffsetY = 0;
ctx.shadowOffsetX = -1;
ctx.fillText(txt, x, y);
ctx.shadowOffsetY = 0;
ctx.shadowOffsetX = 1;
ctx.fillText(txt, x, y);
ctx.shadowOffsetX = 0;
}
// inner Platform class
class _VerilogPlatform extends BasePlatform implements WaveformProvider {