Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit fc87b21

Browse files
committed
feat(calibrator): move to gemini-core
1 parent 5006927 commit fc87b21

File tree

12 files changed

+181
-396
lines changed

12 files changed

+181
-396
lines changed

lib/browser-pool.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

3-
const BrowserPool = require('gemini-core').BrowserPool;
4-
const Calibrator = require('./calibrator');
3+
const {BrowserPool, Calibrator} = require('gemini-core');
54
const Browser = require('./browser');
65
const Events = require('./constants/events');
76

lib/browser/camera.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ module.exports = class Camera {
6363
return image;
6464
}
6565

66-
return image.crop({
67-
left: this._calibration.left,
68-
top: this._calibration.top,
69-
width: image.getSize().width - this._calibration.left,
70-
height: image.getSize().height - this._calibration.top
71-
});
66+
const {left, top} = this._calibration;
67+
const {width, height} = image.getSize();
68+
69+
return image.crop({left, top, width: width - left, height: height - top});
7270
}
7371

7472
_cropToViewport(image, page) {

lib/browser/client-scripts/gemini.calibrate.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

lib/calibrator.js

Lines changed: 0 additions & 140 deletions
This file was deleted.

0 commit comments

Comments
 (0)