mirror of
https://github.com/rastapasta/mapscii.git
synced 2024-11-23 08:33:18 +01:00
Change the unit of width and length options to full characters
This commit is contained in:
parent
9eb2e5ef25
commit
5c8ded81dc
6
main.js
6
main.js
@ -31,12 +31,12 @@ const argv = require('yargs')
|
|||||||
})
|
})
|
||||||
.option('width', {
|
.option('width', {
|
||||||
alias: 'w',
|
alias: 'w',
|
||||||
description: 'Fixed width of rendering in dot units',
|
description: 'Fixed width of rendering',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
})
|
})
|
||||||
.option('height', {
|
.option('height', {
|
||||||
alias: 'h',
|
alias: 'h',
|
||||||
description: 'Fixed height of rendering in dot units',
|
description: 'Fixed height of rendering',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
})
|
})
|
||||||
.option('braille', {
|
.option('braille', {
|
||||||
@ -78,7 +78,7 @@ const options = {
|
|||||||
headless: argv.headless,
|
headless: argv.headless,
|
||||||
source: argv.tile_source,
|
source: argv.tile_source,
|
||||||
styleFile: argv.style_file,
|
styleFile: argv.style_file,
|
||||||
}
|
};
|
||||||
|
|
||||||
const mapscii = new Mapscii(options);
|
const mapscii = new Mapscii(options);
|
||||||
mapscii.init().catch((err) => {
|
mapscii.init().catch((err) => {
|
||||||
|
@ -93,8 +93,8 @@ class Mapscii {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_resizeRenderer() {
|
_resizeRenderer() {
|
||||||
this.width = config.size && config.size.width ? config.size.width : config.output.columns >> 1 << 2;
|
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 : config.output.rows * 4 - 4;
|
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;
|
this.minZoom = 4-Math.log(4096/this.width)/Math.LN2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user