editor: use css variable --grid-width at startup (allow overriding) and after disabling & enabling the grid
This commit is contained in:
parent
1c5876246b
commit
db165faa9f
4 changed files with 9 additions and 4 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
- bug fixes
|
||||
- button: all writing strings like `"1.0"` in `label` without removing the decimals
|
||||
- editor: use css variable `--grid-width` at startup (allow overriding) and after disabling & enabling the grid
|
||||
|
||||
- midi
|
||||
- allow sending note off with velocity
|
||||
|
|
|
|||
|
|
@ -405,9 +405,9 @@ class Editor {
|
|||
|
||||
this.grid = !this.grid
|
||||
|
||||
GRIDWIDTH = this.grid ? 10 : 1
|
||||
GRIDWIDTH = this.grid ? GRIDWIDTH_CSS : 1
|
||||
|
||||
document.documentElement.style.setProperty('--grid-width', GRIDWIDTH)
|
||||
document.body.style.setProperty('--grid-width', GRIDWIDTH)
|
||||
document.body.classList.toggle('no-grid', GRIDWIDTH == 1)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ window.PACKAGE = require('../../package.json')
|
|||
window.LOADING = null
|
||||
|
||||
window.READ_ONLY = window.READ_ONLY || false
|
||||
window.GRIDWIDTH = 10
|
||||
window.GRIDWIDTH_CSS = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
window.GRIDWIDTH = GRIDWIDTH_CSS
|
||||
|
||||
|
||||
|
||||
window.ELECTRON_NOGPU = false
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@ module.exports = {
|
|||
setTimeout(()=>{
|
||||
var root = widgetManager.getWidgetById('root')[0]
|
||||
if (root) root.onPropChanged('color')
|
||||
GRIDWIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
GRIDWIDTH_CSS = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
editor.toggleGrid()
|
||||
editor.toggleGrid()
|
||||
},200)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue