Skip to content

Commit

Permalink
#440 trying to equal styles with normal <p>
Browse files Browse the repository at this point in the history
  • Loading branch information
oleojake committed Jan 2, 2025
1 parent 1b83cda commit d2b3574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ const generateImage = (
domElement.style.fontSize = `${fontSize}px`;
domElement.style.color = textColor;
domElement.style.textAlign = textAlignment;
domElement.style.lineHeight = '1';
domElement.style.fontWeight = 'normal';
domElement.style.textWrap = 'wrap';
domElement.style.fontFamily = BASIC_SHAPE.DEFAULT_FONT_FAMILY;
domElement.innerHTML = parseTextWithFormatting(text);
document.body.appendChild(domElement);

html2canvas(domElement, {
backgroundColor: 'rgba(0,0,0,0)',
scale: 2,
}).then(canvas => {
const image = new window.Image();
image.src = canvas.toDataURL();
Expand Down
2 changes: 1 addition & 1 deletion src/pods/canvas/model/shape-other-props.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const generateDefaultOtherProps = (
case 'richtext':
return {
textColor: `${BASIC_SHAPE.DEFAULT_STROKE_COLOR}`,
fontSize: 16,
fontSize: FONT_SIZE_VALUES.PARAGRAPH,
textAlignment: `${BASIC_SHAPE.DEFAULT_TEXT_ALIGNMENT}`,
};
case 'label':
Expand Down

0 comments on commit d2b3574

Please sign in to comment.