Skip to content

#109 Adding Preview support for Master Slide backgrounds#640

Merged
wyozi merged 4 commits intowyozi:masterfrom
karankrishnani:master
Sep 30, 2022
Merged

#109 Adding Preview support for Master Slide backgrounds#640
wyozi merged 4 commits intowyozi:masterfrom
karankrishnani:master

Conversation

@karankrishnani
Copy link
Copy Markdown
Contributor

No description provided.

@karankrishnani
Copy link
Copy Markdown
Contributor Author

Lots of the changes are formatting because I setup my prettier on vscode.

The main changes I have made are in SlidePreview component:

+
+  const backgroundColor = slide.backgroundColor ?? masterSlide?.backgroundColor;
+  const backgroundImage = slide.backgroundImage ?? masterSlide?.backgroundImage;
+
   return (
     <div
       ref={ref}
       style={{
         width: "100%",
         height: width / (dimensions[0] / dimensions[1]),
-        backgroundColor: slide.backgroundColor
-          ? normalizedColorToCSS(slide.backgroundColor)
+        backgroundColor: backgroundColor
+          ? normalizedColorToCSS(backgroundColor)
           : "white",
         backgroundImage:
-          slide.backgroundImage && slide.backgroundImage?.kind === "path"
-            ? `url("${slide.backgroundImage.path}")`
-            : `url("data:${slide.backgroundImage?.data}")`,
+          backgroundImage && backgroundImage?.kind === "path"
+            ? `url("${backgroundImage.path}")`
+            : `url("data:${backgroundImage?.data}")`,
+        backgroundSize: "contain",

@karankrishnani
Copy link
Copy Markdown
Contributor Author

Updated the PR to include image support.

Comment thread src/renderer.ts Outdated
@wyozi wyozi merged commit eaaf65e into wyozi:master Sep 30, 2022
@wyozi
Copy link
Copy Markdown
Owner

wyozi commented Sep 30, 2022

Thanks 👍

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.17.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants