Commit 6d628edd authored by zhengke's avatar zhengke

画布 横竖 滚动条 优化

parent f87c7468
......@@ -268,16 +268,16 @@ const throttleScaleCanvas = throttle(scaleCanvas, 100, { leading: true, trailing
const throttleUpdateSlideIndex = throttle(updateSlideIndex, 300, { leading: true, trailing: false })
const handleMousewheelCanvas = (e: WheelEvent) => {
return
e.preventDefault()
// 按住Ctrl键时:缩放画布
if (ctrlKeyState.value) {
e.preventDefault()
if (e.deltaY > 0) throttleScaleCanvas('-')
else if (e.deltaY < 0) throttleScaleCanvas('+')
}
// 上下翻页
else {
return
if (e.deltaY > 0) throttleUpdateSlideIndex(KEYS.DOWN)
else if (e.deltaY < 0) throttleUpdateSlideIndex(KEYS.UP)
}
......
......@@ -8,7 +8,7 @@
<CanvasTool class="center-top" />
<div style="height: 873px;overflow: scroll;">
<!-- <Canvas class="center-body" :style="{ height: `calc(100% - 40px)`}" /> -->
<Canvas class="center-body" :style="{ height: viewportRatio<1?'calc(1240px - 40px)':'calc(1754px - 40px)'}" />
<Canvas class="center-body" :style="{ height: viewportRatio<1?'calc(1240px - 375px)':'calc(1754px - 900px)'}" />
</div>
<!-- <Remark
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment