editor zoom: adjust root widget size when zooming out
This commit is contained in:
parent
ed63e2c063
commit
99db67dd5d
4 changed files with 20 additions and 11 deletions
|
|
@ -1,10 +1,15 @@
|
|||
# Changelog
|
||||
|
||||
## 1.19.1
|
||||
|
||||
- bug fixes
|
||||
- editor zoom: adjust root widget size when zooming out
|
||||
|
||||
## 1.19.0
|
||||
|
||||
- editor
|
||||
- add keyboard shortcut "h" to hide selection and widget drag / resize handles while pressed
|
||||
- inspector: add some shortcut buttons in the header
|
||||
- inspector: add some shortcut buttons in the header
|
||||
|
||||
- widgets
|
||||
- add folder widget (flat container that doesn't affect layout)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ class Zoom extends EventEmitter {
|
|||
requestAnimationFrame(()=>{
|
||||
this.localZoom = zoom
|
||||
document.documentElement.style.setProperty('--local-zoom', this.localZoom)
|
||||
document.body.classList.toggle('local-zoom-in', this.localZoom > 1)
|
||||
document.body.classList.toggle('local-zoom-out', this.localZoom < 1)
|
||||
this.trigger('local-zoom-changed')
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -796,13 +796,16 @@ osc-inspector-color {
|
|||
}
|
||||
|
||||
|
||||
.editor-enabled {
|
||||
osc-panel-container.center {
|
||||
overflow: auto;
|
||||
background: var(--color-background);
|
||||
}
|
||||
#osc-container {
|
||||
transform-origin: 0 0;
|
||||
transform: scale(var(--local-zoom));
|
||||
}
|
||||
.editor-enabled.local-zoom-in .root-container {
|
||||
transform-origin: top left;
|
||||
transform: scale(var(--local-zoom));
|
||||
min-width: calc(100% / var(--local-zoom));
|
||||
min-height: calc(100% / var(--local-zoom));
|
||||
}
|
||||
|
||||
.editor-enabled.local-zoom-out .root-container {
|
||||
transform-origin: center left;
|
||||
transform: scale(var(--local-zoom));
|
||||
min-width: calc(100% / var(--local-zoom));
|
||||
min-height: calc(100% / var(--local-zoom));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ osc-panel-container {
|
|||
flex: 1;
|
||||
z-index: 1;
|
||||
min-width: 100rem;
|
||||
background: rgba(black, 0.35)!important
|
||||
}
|
||||
|
||||
&.left, &.right {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue