Skip to content

Commit

Permalink
fix: reduce the chance of blurry text
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and tiensonqin committed Dec 28, 2022
1 parent 376d97f commit 921418d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,17 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {

const { Breadcrumb, PageName } = renderers

const portalStyle : React.CSSProperties = {
width: `calc(100% / ${scaleRatio})`,
height: `calc(100% / ${scaleRatio})`,
opacity: isErasing ? 0.2 : 1,
}

// Reduce the chance of blurry text
if (scaleRatio !== 1) {
portalStyle.transform = `scale(${scaleRatio})`
}

return (
<HTMLContainer
style={{
Expand Down Expand Up @@ -478,12 +489,7 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
data-page-id={pageId}
data-portal-selected={portalSelected}
data-editing={isEditing}
style={{
width: `calc(100% / ${scaleRatio})`,
height: `calc(100% / ${scaleRatio})`,
transform: `scale(${scaleRatio})`,
opacity: isErasing ? 0.2 : 1,
}}
style={portalStyle}
>
{!this.props.compact && !targetNotFound && (
<LogseqPortalShapeHeader
Expand Down

0 comments on commit 921418d

Please sign in to comment.