mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-16 05:10:00 +01:00
Added options startingX and startingY in Add-Qr Module (#1520)
* Added options startingX and startingY in Add-Qr Module * requeste changes * Fixing Qr Code at the end when not fit in the image Co-authored-by: Rishabh Shukla <42492389+blurry-x-face@users.noreply.github.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
2fba0d2074
commit
2b3e5a2915
@@ -12,11 +12,11 @@ module.exports = exports = function (options, pixels, oldPixels, cb) {
|
||||
const width = oldPixels.shape[0],
|
||||
height = oldPixels.shape[1];
|
||||
|
||||
const xe = width - options.size, // Starting pixel coordinates
|
||||
ye = height - options.size;
|
||||
|
||||
for (let x = xe; x < width; x++) {
|
||||
for (let y = ye; y < height; y++) {
|
||||
const xe = Math.min(options.startingX, width - options.size), // Starting pixel coordinates
|
||||
ye = Math.min(options.startingY, height - options.size);
|
||||
|
||||
for (let x = xe; x < Math.min(xe + options.size, width); x++) {
|
||||
for (let y = ye; y < Math.min(ye + options.size, height); y++) {
|
||||
pixelSetter(
|
||||
x,
|
||||
y,
|
||||
|
||||
Reference in New Issue
Block a user