Fix some crashes and improve pixel alignment
This commit is contained in:
parent
0ea9b157c7
commit
e385c7291c
|
@ -69,7 +69,7 @@
|
||||||
z-index: var(--zIndex);
|
z-index: var(--zIndex);
|
||||||
border: 2px solid var(--color);
|
border: 2px solid var(--color);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
border-radius: 4px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
.indicator.withText {
|
.indicator.withText {
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
let callbackCount = 0
|
let callbackCount = 0
|
||||||
|
|
||||||
$: visibleIndicators = state.indicators.filter(x => x.visible)
|
$: visibleIndicators = state.indicators.filter(x => x.visible)
|
||||||
$: offset = $builderStore.inBuilder ? 0 : 2
|
|
||||||
|
|
||||||
// Update position when any props change
|
// Update position when any props change
|
||||||
$: config.set({
|
$: config.set({
|
||||||
|
@ -150,10 +149,10 @@
|
||||||
|
|
||||||
const elBounds = child.getBoundingClientRect()
|
const elBounds = child.getBoundingClientRect()
|
||||||
nextState.indicators.push({
|
nextState.indicators.push({
|
||||||
top: elBounds.top + scrollY - deviceBounds.top - offset,
|
top: Math.round(elBounds.top + scrollY - deviceBounds.top + 1),
|
||||||
left: elBounds.left + scrollX - deviceBounds.left - offset,
|
left: Math.round(elBounds.left + scrollX - deviceBounds.left + 1),
|
||||||
width: elBounds.width + 4,
|
width: Math.round(elBounds.width + 2),
|
||||||
height: elBounds.height + 4,
|
height: Math.round(elBounds.height + 2),
|
||||||
visible: false,
|
visible: false,
|
||||||
insideSidePanel: !!child.closest(".side-panel"),
|
insideSidePanel: !!child.closest(".side-panel"),
|
||||||
insideModal: !!child.closest(".modal-content"),
|
insideModal: !!child.closest(".modal-content"),
|
||||||
|
|
|
@ -77,8 +77,8 @@ const alignmentToStyleMap = {
|
||||||
stretch: "stretch",
|
stretch: "stretch",
|
||||||
}
|
}
|
||||||
export const getBaseGridVars = definition => {
|
export const getBaseGridVars = definition => {
|
||||||
const gridHAlign = definition.grid?.hAlign || "stretch"
|
const gridHAlign = definition?.grid?.hAlign || "stretch"
|
||||||
const gridVAlign = definition.grid?.vAlign || "center"
|
const gridVAlign = definition?.grid?.vAlign || "center"
|
||||||
const flexStyles = gridVAlign === "stretch" ? "1 1 0" : "0 0 auto"
|
const flexStyles = gridVAlign === "stretch" ? "1 1 0" : "0 0 auto"
|
||||||
return {
|
return {
|
||||||
["--grid-desktop-h-align"]: alignmentToStyleMap[gridHAlign],
|
["--grid-desktop-h-align"]: alignmentToStyleMap[gridHAlign],
|
||||||
|
|
Loading…
Reference in New Issue