fix: set default size to 120x60

pull/1/head
flop 4 weeks ago
parent 01a032ffc8
commit 18f8749594
  1. 6
      ts/index.html
  2. 8
      ts/src/driver.ts

@ -555,9 +555,9 @@
<div id="main">
<div id="left">
<span class="pv-label">preview · 160 × 80</span>
<span class="pv-label">preview · 120 × 60</span>
<div id="display-box">
<canvas id="canvas_root" width="160" height="80"></canvas>
<canvas id="canvas_root" width="120" height="60"></canvas>
</div>
<span class="pv-label">demos</span>
<div id="demo-btns"></div>
@ -604,7 +604,7 @@
<script src="./public/mono-display.js"></script>
<script>
const W = 160, H = 80;
const W = 120, H = 60;
let sections = [];
let activeSec = null, activeEl = null;
let secCounter = 0, elCounter = 0;

@ -16,9 +16,9 @@ export interface MonoDisplayDriverOptions {
* Keep at 1 and use CSS to stretch for crisp upscaling.
*/
scale?: number;
/** Default display width for elements without inherent size. Default 160. */
/** Default display width for elements without inherent size. Default 120. */
displayWidth?: number;
/** Default display height. Default 80. */
/** Default display height. Default 60. */
displayHeight?: number;
/**
* Render rate in ticks per second. All animations and scrolls are driven by this.
@ -67,8 +67,8 @@ export class MonoDisplayDriver {
onColor: options.onColor ?? "#ffffff",
offColor: options.offColor ?? "#000000",
scale: options.scale ?? 1,
displayWidth: options.displayWidth ?? 160,
displayHeight: options.displayHeight ?? 80,
displayWidth: options.displayWidth ?? 120,
displayHeight: options.displayHeight ?? 60,
fps: options.fps ?? 25,
loop: options.loop ?? true,
onError: options.onError ?? ((e: Error) => { throw e; }),

Loading…
Cancel
Save