"use strict";
cc._RF.push(module, 'def1beU8c5N+b/6UOssF6Wm', 'Responsive');
// Responsive.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {},
  onLoad: function onLoad() {
    this.makeResponsive();
  },
  makeResponsive: function makeResponsive() {
    var canvas = this.node.getComponent(cc.Canvas);
    var deviceResolution = cc.view.getFrameSize(); // calculte design ratio

    var desiredRatio = canvas.designResolution.width / canvas.designResolution.height; // calculte device ratio

    var deviceRatio = deviceResolution.width / deviceResolution.height;

    if (deviceRatio >= desiredRatio) {
      canvas.fitHeight = true;
      canvas.fitWidth = false;
    } else if (deviceRatio < desiredRatio) {
      canvas.fitHeight = false;
      canvas.fitWidth = true;
    }
  }
});

cc._RF.pop();