Skip to main content

clamp 设置限制范围

clamp

类型: MethodDeclaration

定义位置: camera.ts

描述

设置限制范围

参数

参数名类型描述默认值
leftnumber--
topnumber--
rightnumber--
bottomnumber--

返回值

类型: void

源代码

位置: 第 189 行

public clamp(left: number, top: number, right: number, bottom: number): void {
this.clampedLeft = Math.min(left, right)
this.clampedTop = Math.min(top, bottom)
this.clampedRight = Math.max(left, right)
this.clampedBottom = Math.max(top, bottom)
}

文档生成时间:2025/7/7 12:07:06