Skip to content

YY. Size ​

用来表示大小的对象,有 width 和 height 组成,比如一个 Div 的大小

creation ​

  • constructor(width, height)
js
var size = new YY.Size(100, 200);

//width=100,height=2000

properties ​

  • {float} size.width
  • {float} size.height

method ​

clone() ​

add(size) ​

  • 两个 size 相加

  • 参数

  • 返回值: YY. Size

multiplyBy(number) ​

  • size 的值乘以值

  • 参数

    • {Number} number:数值
  • 返回值: YY. Size

divideBy(number) ​

  • size 的值除以值

  • 参数

    • {Number} number:数值
  • 返回值: YY. Size

toString() ​

  • 字符串序列化
  • 返回值: String

toArray() ​

  • 数组序列化
  • 返回值: Array

This document is generated by vitepress and Edit by deyihu