Skip to content

Commit

Permalink
Set style width and height to 100% to render correctly in anki
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuuuube committed Dec 25, 2024
1 parent 07581c7 commit 9d4b74e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/js/display/structured-content-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export class StructuredContentGenerator {
image.width = width;
image.height = image.width * invAspectRatio;

// Anki will not render images correctly without specifying to use 100% width and height
image.style.width = '100%';
image.style.height = '100%';

imageContainer.appendChild(image);

if (this._contentManager instanceof DisplayContentManager) {
Expand Down

0 comments on commit 9d4b74e

Please sign in to comment.