Fix subpixel grid sizes

This commit is contained in:
Mononaut 2021-03-22 15:23:43 -06:00
parent a368640682
commit 2a88138ce7
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import config from '../config.js'
class TxStream {
constructor () {
this.websocketUri = (config.dev ? `ws://localhost:5000${config.websocket_path}` : `wss://${window.location.host}${config.websocket_path}`)
this.websocketUri = config.localSocket ? `ws://localhost:4000${config.websocket_path}` : (config.dev ? `wss://bits.monospace.live${config.websocket_path}` : `wss://${window.location.host}${config.websocket_path}`)
this.reconnectBackoff = 128
this.websocket = null
this.setConnected(false)

View File

@ -40,8 +40,8 @@ export default class TxPoolScene {
resize ({ width = this.width, height = this.height }) {
this.width = width
this.height = height
this.unitWidth = Math.max(4, width / 250)
this.unitPadding = Math.max(1, width / 1000)
this.unitWidth = Math.floor(Math.max(4, width / 250))
this.unitPadding = Math.floor(Math.max(1, width / 1000))
this.gridSize = this.unitWidth + (this.unitPadding * 2)
this.blockWidth = (Math.floor(width / this.gridSize) - 1)
this.blockHeight = (Math.floor(height / this.gridSize) - 1)