@diegotsi/flint-react 0.3.1 → 0.3.2
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.cjs
CHANGED
|
@@ -7910,12 +7910,14 @@ function ScreenAnnotator({ zIndex: zIndex2, onCapture, onCancel }) {
|
|
|
7910
7910
|
});
|
|
7911
7911
|
unpatch();
|
|
7912
7912
|
const dpr = window.devicePixelRatio ?? 1;
|
|
7913
|
+
const sx = window.scrollX ?? window.pageXOffset ?? 0;
|
|
7914
|
+
const sy = window.scrollY ?? window.pageYOffset ?? 0;
|
|
7913
7915
|
const ctx = canvas.getContext("2d");
|
|
7914
7916
|
ctx.fillStyle = "rgba(255,200,0,0.25)";
|
|
7915
|
-
ctx.fillRect(finalRect.x * dpr, finalRect.y * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7917
|
+
ctx.fillRect((finalRect.x + sx) * dpr, (finalRect.y + sy) * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7916
7918
|
ctx.strokeStyle = "#f97316";
|
|
7917
7919
|
ctx.lineWidth = 3 * dpr;
|
|
7918
|
-
ctx.strokeRect(finalRect.x * dpr, finalRect.y * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7920
|
+
ctx.strokeRect((finalRect.x + sx) * dpr, (finalRect.y + sy) * dpr, finalRect.w * dpr, finalRect.h * dpr);
|
|
7919
7921
|
canvas.toBlob((blob) => {
|
|
7920
7922
|
if (blob) {
|
|
7921
7923
|
onCapture(new File([blob], "annotation.png", { type: "image/png" }));
|