Skip to content

Commit

Permalink
#2043 Update font size for templates (temporal workaround) WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
porcelain11 committed Jan 10, 2023
1 parent 3a30234 commit a11089d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ketcher-react/src/script/ui/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const AUTO_SCALE_MARGIN = 15
export const FONT_SIZE = 55
export const FONT_SIZE = 25
export const BOND_THICKNESS = 4
export const DOUBLE_BOND_WIDTH = 10
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ const RenderTmpl: FC<{
options: any
className: string
}> = ({ tmpl, options, ...props }) => {
const fontSize = tmpl.struct.name === 'Me' ? FONT_SIZE / 2 : FONT_SIZE

return (
<StructRender
struct={tmpl.struct}
options={{
...options,
autoScaleMargin: AUTO_SCALE_MARGIN,
fontsz: FONT_SIZE,
fontszsub: FONT_SIZE,
fontsz: fontSize,
fontszsub: fontSize,
bondThickness: BOND_THICKNESS,
doubleBondWidth: DOUBLE_BOND_WIDTH
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ const prerenderPartOfStructures = (saltsAndSolvents: Struct[], settings) => {
div.style.height = '100px'
div.style.display = 'none'
document.body.appendChild(div)

const fontSize = struct.name === 'water' ? FONT_SIZE / 2 : FONT_SIZE * 2

RenderStruct.render(div, struct, {
...settings,
autoScaleMargin: AUTO_SCALE_MARGIN,
fontsz: FONT_SIZE,
fontszsub: FONT_SIZE,
fontsz: fontSize,
fontszsub: fontSize,
bondThickness: BOND_THICKNESS,
doubleBondWidth: DOUBLE_BOND_WIDTH
})
Expand Down

0 comments on commit a11089d

Please sign in to comment.