Skip to content

Commit

Permalink
feat: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jianqi-jin authored and jianqi jin committed Aug 22, 2023
1 parent 40eacc6 commit 885fdc1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/component/dataZoom/roams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function mergeControllerParams(dataZoomInfoMap: HashMap<{ model: InsideZoomModel
let gestureOnTouchPad = false;
dataZoomInfoMap.each(function (dataZoomInfo) {
const dataZoomModel = dataZoomInfo.model;
gestureOnTouchPad = gestureOnTouchPad || !!dataZoomModel.get('gestureOnTouchPad')
gestureOnTouchPad = gestureOnTouchPad || !!dataZoomModel.get('gestureOnTouchPad');
const oneType = dataZoomModel.get('disabled', true)
? false
: dataZoomModel.get('zoomLock', true)
Expand Down
19 changes: 15 additions & 4 deletions src/component/helper/RoamController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class RoamController extends Eventful<{
const absWheelDeltaDelta = Math.abs(wheelDelta);
const originX = e.offsetX;
const originY = e.offsetY;

// wheelDelta maybe -0 in chrome mac.
if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {
return;
Expand All @@ -264,10 +264,13 @@ class RoamController extends Eventful<{
const zoomFactor = 1.1;
const wheelZoomSpeed = 1 / 23;
// FIXME zrender type error
let wheelEvent = e.event as unknown as WheelEvent;
const wheelEvent = e.event as unknown as WheelEvent;
if (wheelEvent.ctrlKey) {
shouldZoom && checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {
scale: 1 / Math.pow(zoomFactor, wheelEvent.deltaY * wheelZoomSpeed), originX, originY, isAvailableBehavior: null
scale: 1 / Math.pow(zoomFactor, wheelEvent.deltaY * wheelZoomSpeed),
originX,
originY,
isAvailableBehavior: null
});
}
else {
Expand All @@ -281,7 +284,15 @@ class RoamController extends Eventful<{
}
shouldMove && checkPointerAndTrigger(this, 'pan', 'moveOnMouseMove', e, {
// @ts-nocheck
originX, originY, oldX: originX, oldY: originY, dx: - offsetX, dy: - offsetY, newX: originX - offsetX, newY: originY - offsetY, isAvailableBehavior: null
originX,
originY,
oldX: originX,
oldY: originY,
dx: -offsetX,
dy: -offsetY,
newX: originX - offsetX,
newY: originY - offsetY,
isAvailableBehavior: null
} as RoamEventParams['pan']);
}
return;
Expand Down

0 comments on commit 885fdc1

Please sign in to comment.