html-reporter 9.9.0 → 9.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ <a name="9.9.1"></a>
6
+ ## [9.9.1](https://github.com/gemini-testing/html-reporter/compare/v9.9.0...v9.9.1) (2023-05-30)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * 3-up scaled to fit diff bubble ([58aefb8](https://github.com/gemini-testing/html-reporter/commit/58aefb8))
12
+
13
+
14
+
5
15
  <a name="9.9.0"></a>
6
16
  # [9.9.0](https://github.com/gemini-testing/html-reporter/compare/v9.8.3...v9.9.0) (2023-05-11)
7
17
 
@@ -7,6 +7,7 @@ import {CIRCLE_RADIUS} from '../../../../constants/defaults';
7
7
 
8
8
  export default class DiffCircle extends Component {
9
9
  static propTypes = {
10
+ originalImageWidth: PropTypes.number.isRequired,
10
11
  diffTarget: PropTypes.object.isRequired,
11
12
  diffBounds: PropTypes.object.isRequired,
12
13
  display: PropTypes.bool.isRequired,
@@ -14,9 +15,9 @@ export default class DiffCircle extends Component {
14
15
  };
15
16
 
16
17
  _getRect() {
17
- const {diffBounds, diffTarget} = this.props;
18
+ const {originalImageWidth, diffBounds, diffTarget} = this.props;
18
19
  const targetRect = diffTarget.getBoundingClientRect();
19
- const sizeCoeff = diffTarget.offsetWidth / parseInt(diffTarget.style.width);
20
+ const sizeCoeff = diffTarget.offsetWidth / originalImageWidth;
20
21
 
21
22
  const rectHeight = Math.ceil(sizeCoeff * (diffBounds.bottom - diffBounds.top + 1));
22
23
  const rectWidth = Math.ceil(sizeCoeff * (diffBounds.right - diffBounds.left + 1));
@@ -33,6 +33,7 @@ class ResizedScreenshot extends Component {
33
33
  _getScreenshotComponent(elem, diffClusters) {
34
34
  return <Fragment>
35
35
  {diffClusters && diffClusters.map((c, id) => <DiffCircle
36
+ originalImageWidth={this.props.image.size.width}
36
37
  diffTarget={this.state.diffTarget}
37
38
  display={this.state.showDiffCircle}
38
39
  toggleDiff={this.toggleDiff}