{"size": 1047, "ext": "js", "max_stars_repo_path": "helpers/set_frame.js", "max_stars_repo_name": "ericfs/phoenix", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "helpers/set_frame.js", "max_issues_repo_name": "ericfs/phoenix", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "helpers/set_frame.js", "max_forks_repo_name": "ericfs/phoenix", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.2972972973, "max_line_length": 76, "alphanum_fraction": 0.6953199618}

/* SET FRAME */

((exports) => {

function setFrame ( ratioFrame, window = Window.focused () ) {
  const {x, y, width, height} = ratioFrame;
  if ( !window ) return;

  const screen = window.screen (),
        frame = screen.flippedVisibleFrame ();

  History.get().pushWindow(window);
  window.setFrame ({
    x: frame.x + ( frame.width * x ),
    y: frame.y + ( frame.height * y ),
    width: frame.width * width,
    height: frame.height * height
  });
}

// Record the new frame before actually setting it. This allows
// the window change listeners to avoid handling a change that is
// already applied.
Window.prototype.nativeSetFrame = Window.prototype.setFrame;
Window.prototype.setFrame = function(frame) {
  this.nativeSetFrame(frame);
  // Record the newly set window dimensions. The values read from the window
  // may be rounded or otherwise different from the requested values.
  // This will be updated before the async window resize event.
  windowState.updateWindowState(this);
};

exports.setFrame = setFrame;

})(globalThis);
