Skip to content

Commit 82222e4

Browse files
committed
Refactor BASE_SPEED definition for clarity
Updated the definition of the `BASE_SPEED` constant to use the nullish coalescing operator (`??`) instead of a ternary operator. This change simplifies the code by ensuring `BASE_SPEED` is set to `viewer.zoomSpeed` if defined, or defaults to `0.015` if not. Retained the existing comment for context.
1 parent efaf7aa commit 82222e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BootstrapBlazor/wwwroot/modules/viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default {
147147

148148

149149
// 配置缩放速度因子(值越大缩放越快)
150-
const BASE_SPEED = viewer.zoomSpeed ? viewer.zoomSpeed : 0.015; // 基础速度
150+
const BASE_SPEED = viewer.zoomSpeed ?? 0.015; // 基础速度
151151

152152
const handlerWheel = e => {
153153
e.preventDefault();

0 commit comments

Comments
 (0)