[Bug] Fix DOM widgets position when canvas bounding box change (#3565)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-04-22 15:11:54 -04:00
committed by GitHub
parent b7535755f0
commit 585d52e24e
7 changed files with 88 additions and 84 deletions

View File

@@ -37,13 +37,14 @@ const { widget, widgetState } = defineProps<{
}>()
const emit = defineEmits<{
(e: 'update:widgetValue', value: string | object): void
'update:widgetValue': [value: string | object]
}>()
const widgetElement = ref<HTMLElement | undefined>()
const { style: positionStyle, updatePositionWithTransform } =
useAbsolutePosition()
const { style: positionStyle, updatePosition } = useAbsolutePosition({
useTransform: true
})
const { style: clippingStyle, updateClipPath } = useDomClipping()
const style = computed<CSSProperties>(() => ({
...positionStyle.value,
@@ -94,7 +95,7 @@ const updateDomClipping = () => {
watch(
() => widgetState,
(newState) => {
updatePositionWithTransform(newState)
updatePosition(newState)
if (enableDomClipping.value) {
updateDomClipping()
}