Skip to main content

point_in_rect

Function point_in_rect 

Source
pub fn point_in_rect(
    x: f32,
    y: f32,
    rect_x: f32,
    rect_y: f32,
    rect_width: f32,
    rect_height: f32,
) -> bool
Expand description

工具函数相关功能 检查点是否在矩形内

§参数

  • x: 点的 x 坐标
  • y: 点的 y 坐标
  • rect_x: 矩形的 x 坐标
  • rect_y: 矩形的 y 坐标
  • rect_width: 矩形的宽度
  • rect_height: 矩形的高度

§返回值

点是否在矩形内