Skip to content

Commit 23ad4f4

Browse files
committed
account for mask pixeldensity
1 parent 84d4d0c commit 23ad4f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/image/p5.Image.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,11 @@ p5.Image = class {
883883
if (p5Image instanceof p5.Renderer) {
884884
maskScaleFactor = p5Image._pInst._pixelDensity;
885885
}
886+
if (p5Image instanceof p5.Image) {
887+
maskScaleFactor = p5Image._pixelDensity;
888+
}
889+
console.log('mask density ' + maskScaleFactor + ' image density ' + imgScaleFactor);
890+
maskScaleFactor /= imgScaleFactor;
886891

887892
const copyArgs = [
888893
p5Image,

0 commit comments

Comments
 (0)