px static method

dynamic px(
  1. dynamic number
)

px转实际尺寸

number 需要转换的像素值

Implementation

static px(number) {
  if (_ratio == 0) {
    Adapt.init(canvasWidth);
  }
  return number * _ratio;
}