diff --git a/tldraw/apps/tldraw-logseq/src/lib/shapes/BoxShape.tsx b/tldraw/apps/tldraw-logseq/src/lib/shapes/BoxShape.tsx index 10b1690362..84352959e9 100644 --- a/tldraw/apps/tldraw-logseq/src/lib/shapes/BoxShape.tsx +++ b/tldraw/apps/tldraw-logseq/src/lib/shapes/BoxShape.tsx @@ -130,41 +130,13 @@ export class BoxShape extends TLBoxShape { const { props: { size: [w, h], - borderRadius, - label, - fontWeight, + borderRadius }, } = this - const bounds = this.getBounds() - const labelSize = label - ? getTextLabelSize( - label, - { fontFamily: 'var(--ls-font-family)', fontSize: 18, lineHeight: 1, fontWeight }, - 4 - ) - : [0, 0] - const scale = Math.max(0.5, Math.min(1, w / labelSize[0], h / labelSize[1])) - const midPoint = Vec.mul(this.props.size, 0.5) - - const offset = React.useMemo(() => { - return Vec.sub(midPoint, Vec.toFixed([bounds.width / 2, bounds.height / 2])) - }, [bounds, scale, midPoint]) - return ( - {label && ( - - )} ) }) diff --git a/tldraw/apps/tldraw-logseq/src/lib/shapes/EllipseShape.tsx b/tldraw/apps/tldraw-logseq/src/lib/shapes/EllipseShape.tsx index 9d824c57f2..3c898ba214 100644 --- a/tldraw/apps/tldraw-logseq/src/lib/shapes/EllipseShape.tsx +++ b/tldraw/apps/tldraw-logseq/src/lib/shapes/EllipseShape.tsx @@ -122,41 +122,12 @@ export class EllipseShape extends TLEllipseShape { ReactIndicator = observer(() => { const { - size: [w, h], - label, - fontWeight, + size: [w, h] } = this.props - const bounds = this.getBounds() - const labelSize = label - ? getTextLabelSize( - label, - { fontFamily: 'var(--ls-font-family)', fontSize: 18, lineHeight: 1, fontWeight }, - 4 - ) - : [0, 0] - const scale = Math.max(0.5, Math.min(1, w / labelSize[0], h / labelSize[1])) - const midPoint = Vec.mul(this.props.size, 0.5) - - const offset = React.useMemo(() => { - const offset = Vec.sub(midPoint, Vec.toFixed([bounds.width / 2, bounds.height / 2])) - return offset - }, [bounds, scale, midPoint]) - return ( - {label && ( - - )} ) }) diff --git a/tldraw/apps/tldraw-logseq/src/lib/shapes/PolygonShape.tsx b/tldraw/apps/tldraw-logseq/src/lib/shapes/PolygonShape.tsx index a72dc94593..a542c2bf6a 100644 --- a/tldraw/apps/tldraw-logseq/src/lib/shapes/PolygonShape.tsx +++ b/tldraw/apps/tldraw-logseq/src/lib/shapes/PolygonShape.tsx @@ -138,44 +138,15 @@ export class PolygonShape extends TLPolygonShape { ReactIndicator = observer(() => { const { offset: [x, y], - props: { label, strokeWidth, fontWeight }, + props: { strokeWidth } } = this - const bounds = this.getBounds() - const labelSize = label - ? getTextLabelSize( - label, - { fontFamily: 'var(--ls-font-family)', fontSize: 18, lineHeight: 1, fontWeight }, - 4 - ) - : [0, 0] - const midPoint = [this.props.size[0] / 2, (this.props.size[1] * 2) / 3] - const scale = Math.max( - 0.5, - Math.min(1, this.props.size[0] / (labelSize[0] * 2), this.props.size[1] / (labelSize[1] * 2)) - ) - - const offset = React.useMemo(() => { - return Vec.sub(midPoint, Vec.toFixed([bounds.width / 2, bounds.height / 2])) - }, [bounds, scale, midPoint]) - return ( - {label && ( - - )} ) })