Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix to cell value vertical-align in tables #5793

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
also adjust for latex vertical align in tables
  • Loading branch information
shun2wang committed Feb 21, 2025
commit 338fed3a1d866452f30b68f9afea7a098835163f
8 changes: 6 additions & 2 deletions Desktop/html/js/jaspwidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ class SvgToPng {
if (svgs.length > 0) {
svgs.forEach(svg => {
const canvas = document.createElement('canvas');
const svgWidth = svg.width ? svg.width.baseVal.value : svg.getAttribute("width")
const svgHeight = svg.height ? svg.height.baseVal.value : svg.getAttribute("Height")
const svgWidth = svg.width ? svg.width.baseVal.value : svg.getAttribute("width");
const svgHeight = svg.height ? svg.height.baseVal.value : svg.getAttribute("height");
const svgDisplay = window.getComputedStyle(svg, null).display;
const svgVerticalAlign = window.getComputedStyle(svg, null).verticalAlign;
canvas.width = parseFloat(svgWidth) * 1.5;
canvas.height = parseFloat(svgHeight) * 1.5;
const img = new Image();
Expand All @@ -49,6 +51,8 @@ class SvgToPng {
newImg.src = pngDataUrl;
newImg.width = svgWidth;
newImg.height = svgHeight;
newImg.style.display = svgDisplay ? svgDisplay : "inline-block";
newImg.style.verticalAlign = svgVerticalAlign ? svgVerticalAlign : "middle";
if (svg.parentNode)
svg.parentNode.replaceChild(newImg, svg);
};
Expand Down