iframeWrapper

This commit is contained in:
xiyang.bai
2021-07-29 14:01:59 +08:00
parent 9946180810
commit 1b7a4557bf
2 changed files with 8 additions and 7 deletions

View File

@@ -7,7 +7,7 @@
*/
import { AllHTMLAttributes, CSSProperties, PropsWithChildren, ReactNode, useRef } from 'react';
import { wrapperEvent } from './event';
import { onWheelEvent } from '../../core/scale';
import { onWheelEventIframe } from '../../core/scale';
import React from 'react';
import Ticker from './ticker';
import UserConfig from '../../config';
@@ -45,7 +45,7 @@ function ContainerWrapper(props: PropsWithChildren<ContainerWrapperProps>) {
...style,
}}
{...wrapperEvent(ref, props.config)}
{...onWheelEvent(props.config)}
{...onWheelEventIframe(props.config, scaleState)}
{...rest}
>
<div

View File

@@ -81,8 +81,9 @@ export const onWheelEventIframe = (
}
if (e.deltaY > 0) {
scaleCancelFn();
if (scale.value < scale.maxValue) {
scale.value = scale.value + 0.1;
//往下滚缩小
if (scale.value > scale.minValue) {
scale.value = scale.value - 0.1;
config.sendParent({
type: 'update',
column: 'scale',
@@ -91,9 +92,9 @@ export const onWheelEventIframe = (
}
} else {
scaleCancelFn();
//往上滚缩小
if (scale.value > scale.minValue) {
scale.value = scale.value - 0.1;
//往上滚放大
if (scale.value < scale.maxValue) {
scale.value = scale.value + 0.1;
config.sendParent({
type: 'update',
column: 'scale',