Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

WIP: adding media-initial commit #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pradeepyadav15may
Copy link
Collaborator

Do not review and merge yet.

Copy link
Owner

@marcog83 marcog83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, thanks for the PR.
Apart the comment I left, your PR looks good to me

@@ -8,6 +8,9 @@ const renderImage = (ctx, node) => {
const {style, options, box } = node;
ctx.addImage({...options,...style,...box});
};
const renderMedia = (ctx, node) => {
ctx.addMedia(node.props);
Copy link
Owner

@marcog83 marcog83 Mar 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see how other functions deal with the parameters, and copy it.
the the idea is that style and box are properties for positioning and sizing, and options contains all other props.
options is supposed to be created in styleMedia function

const {style, options, box } = node; 

ctx.addMedia({...options,...style,...box});

apart from this, great job, you properly get how to create new primitive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants