@diegotsi/flint-react 0.3.1 → 0.3.3
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/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7882,12 +7882,14 @@ function ScreenAnnotator({ zIndex: zIndex2, onCapture, onCancel }) {
|
|
|
7882
7882
|
});
|
|
7883
7883
|
unpatch();
|
|
7884
7884
|
const dpr = window.devicePixelRatio ?? 1;
|
|
7885
|
+
const sx = window.scrollX ?? window.pageXOffset ?? 0;
|
|
7886
|
+
const sy = window.scrollY ?? window.pageYOffset ?? 0;
|
|
7885
7887
|
const ctx = canvas.getContext("2d");
|
|
7886
7888
|
ctx.fillStyle = "rgba(255,200,0,0.25)";
|
|
7887
|
-
ctx.fillRect(finalRect.x * dpr, finalRect.y * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7889
|
+
ctx.fillRect((finalRect.x + sx) * dpr, (finalRect.y + sy) * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7888
7890
|
ctx.strokeStyle = "#f97316";
|
|
7889
7891
|
ctx.lineWidth = 3 * dpr;
|
|
7890
|
-
ctx.strokeRect(finalRect.x * dpr, finalRect.y * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7892
|
+
ctx.strokeRect((finalRect.x + sx) * dpr, (finalRect.y + sy) * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7891
7893
|
canvas.toBlob((blob) => {
|
|
7892
7894
|
if (blob) {
|
|
7893
7895
|
onCapture(new File([blob], "annotation.png", { type: "image/png" }));
|