Skip to content

Commit

Permalink
Fix image position with: remove .addEventListener("load"
Browse files Browse the repository at this point in the history
  • Loading branch information
ollimeier committed Oct 31, 2024
1 parent 648a324 commit a0e4ade
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/fontra/views/editor/visualization-layer-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,7 @@ registerVisualizationLayerDefinition({
const img = new Image();
img.type = "file";
img.src = `http://localhost:8000/MutatorSansLightCondensed.ufo/images/${image.fileName}`;
img.addEventListener("load", () => {
context.drawImage(img, sx, sy, img.width * xScale, img.height * yScale);
});

context.drawImage(img, sx, sy, img.width * xScale, img.height * yScale);
context.strokeStyle = parameters.strokeColor;
context.lineWidth = parameters.strokeWidth;
context.strokeRect(sx, sy, img.width * xScale, img.height * yScale);
Expand Down

0 comments on commit a0e4ade

Please sign in to comment.