mirror of
https://gitee.com/dromara/go-view.git
synced 2025-06-29 16:29:14 +08:00
Pre Merge pull request !215 from yuanmogul/cherry-pick-1697727964
This commit is contained in:
commit
c086fbf77f
@ -164,11 +164,11 @@ const dragCanvas = (e: any) => {
|
|||||||
const canvasBox = () => {
|
const canvasBox = () => {
|
||||||
const layoutDom = document.getElementById('go-chart-edit-layout')
|
const layoutDom = document.getElementById('go-chart-edit-layout')
|
||||||
if (layoutDom) {
|
if (layoutDom) {
|
||||||
// 此处减去滚动条的宽度和高度
|
// 应该减去的是标尺的厚度,虽然都是20,但是这样更容易让人理解
|
||||||
const scrollW = 20
|
// 如果后面改了标尺厚度这里也不用改
|
||||||
return {
|
return {
|
||||||
height: layoutDom.clientHeight - scrollW,
|
height: layoutDom.clientHeight - thick,
|
||||||
width: layoutDom.clientWidth - scrollW
|
width: layoutDom.clientWidth - thick
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -193,7 +193,12 @@ const canvasPosCenter = () => {
|
|||||||
$app.value.scrollLeft = containerWidth / 2 - width / 2
|
$app.value.scrollLeft = containerWidth / 2 - width / 2
|
||||||
$app.value.scrollTop = containerHeight / 2 - height / 2
|
$app.value.scrollTop = containerHeight / 2 - height / 2
|
||||||
}
|
}
|
||||||
|
watch(scale, () => {
|
||||||
|
// 解决首次进来标尺位置不对的问题
|
||||||
|
// 解决每次缩放后标尺位置不对的问题
|
||||||
|
// 直接监听缩放比例的变化,每次重绘标尺组件
|
||||||
|
reDraw()
|
||||||
|
}, { immediate: true })
|
||||||
// 处理主题变化
|
// 处理主题变化
|
||||||
watch(
|
watch(
|
||||||
() => designStore.getDarkTheme,
|
() => designStore.getDarkTheme,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user