Skip to content

Commit

Permalink
Fixing issue with sending non integers to layer function
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Fish <[email protected]>
  • Loading branch information
fishcharlie committed Aug 27, 2024
1 parent 47c7312 commit fdb5cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export async function mapToImage(settings: MapToImageSettings) {
function createImageObject(x: number, y: number, zoom: number, left: number, top: number) {
if (typeof layer === "function") {
return {
"input": (): Buffer | Promise<Buffer> => layer(zoom, x, y),
"input": (): Buffer | Promise<Buffer> => layer(zoom, Math.floor(x), Math.floor(y)),
"left": left,
"top": top,
"opacity": 1
Expand Down

0 comments on commit fdb5cf5

Please sign in to comment.