Change the unit of width and length options to full characters

This commit is contained in:
Christian Paul 2020-08-12 01:58:25 +02:00
parent 9eb2e5ef25
commit 5c8ded81dc
2 changed files with 5 additions and 5 deletions

View File

@ -31,12 +31,12 @@ const argv = require('yargs')
})
.option('width', {
alias: 'w',
description: 'Fixed width of rendering in dot units',
description: 'Fixed width of rendering',
type: 'number',
})
.option('height', {
alias: 'h',
description: 'Fixed height of rendering in dot units',
description: 'Fixed height of rendering',
type: 'number',
})
.option('braille', {
@ -78,7 +78,7 @@ const options = {
headless: argv.headless,
source: argv.tile_source,
styleFile: argv.style_file,
}
};
const mapscii = new Mapscii(options);
mapscii.init().catch((err) => {

View File

@ -93,8 +93,8 @@ class Mapscii {
}
_resizeRenderer() {
this.width = config.size && config.size.width ? config.size.width : config.output.columns >> 1 << 2;
this.height = config.size && config.size.height ? config.size.height : config.output.rows * 4 - 4;
this.width = config.size && config.size.width ? config.size.width * 2 : config.output.columns >> 1 << 2;
this.height = config.size && config.size.height ? config.size.height * 4 : config.output.rows * 4 - 4;
this.minZoom = 4-Math.log(4096/this.width)/Math.LN2;