@sentry/feedback 11.4.0 → 11.6.0

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.
@@ -1565,11 +1565,13 @@ function useTakeScreenshotFactory({ hooks }) {
1565
1565
  function drawRect(command, ctx, color) {
1566
1566
  switch (command.type) {
1567
1567
  case "highlight": {
1568
+ ctx.save();
1568
1569
  ctx.shadowColor = "rgba(0, 0, 0, 0.7)";
1569
1570
  ctx.shadowBlur = 50;
1570
1571
  ctx.fillStyle = color;
1571
1572
  ctx.fillRect(command.x - 1, command.y - 1, command.w + 2, command.h + 2);
1572
1573
  ctx.clearRect(command.x, command.y, command.w, command.h);
1574
+ ctx.restore();
1573
1575
  break;
1574
1576
  }
1575
1577
  case "hide":
@@ -1694,8 +1696,8 @@ function ScreenshotEditorFactory({
1694
1696
  const boundingRect = mouseRef.current.getBoundingClientRect();
1695
1697
  const startingPoint = {
1696
1698
  type: action,
1697
- x: e.offsetX / scaleFactor,
1698
- y: e.offsetY / scaleFactor};
1699
+ x: (e.clientX - boundingRect.x) / scaleFactor,
1700
+ y: (e.clientY - boundingRect.y) / scaleFactor};
1699
1701
  const getDrawCommand = (startingPoint2, e2) => {
1700
1702
  const x = (e2.clientX - boundingRect.x) / scaleFactor;
1701
1703
  const y = (e2.clientY - boundingRect.y) / scaleFactor;