Skip to content

Commit

Permalink
fix:插件面板固定后画布未自适应
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyun8 committed Jan 8, 2024
1 parent 96c4a17 commit 0356e31
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions packages/canvas/src/components/container/CanvasResize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export default {
const mouseDown = ref(false)
const resizeDom = ref(null)
const onMouseMove = (event) => {
if (mouseDown.value) {
event.preventDefault()
calculateSize(event)

Check failure on line 36 in packages/canvas/src/components/container/CanvasResize.vue

View workflow job for this annotation

GitHub Actions / push-check

'calculateSize' was used before it was defined

Check failure on line 36 in packages/canvas/src/components/container/CanvasResize.vue

View workflow job for this annotation

GitHub Actions / push-check

'calculateSize' was used before it was defined
}
}
const calculateSize = ({ movementX }) => {
const dimension = useLayout().getDimension()
const { maxWidth, minWidth, width } = dimension
Expand All @@ -41,13 +48,6 @@ export default {
})
}
const onMouseMove = (event) => {
if (mouseDown.value) {
event.preventDefault()
calculateSize(event)
}
}
const onMouseDown = () => {
const iframe = canvasState.iframe
Expand Down Expand Up @@ -95,7 +95,13 @@ export default {
watch(
() => useLayout().getPluginState().render,
(value) => !value && setScale(),
(value) => {
const currentFixed = useLayout().getPluginState().fixedPanels.includes(value)
if (!value || currentFixed) {
setScale()
}
},
{ flush: 'post' }
)
Expand Down

0 comments on commit 0356e31

Please sign in to comment.