[fix] text shape outline (#1974)

This PR fixes the text shape outline.

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
Steve Ruiz 2023-10-02 12:14:37 +01:00 committed by GitHub
parent 852187058a
commit 3fa7dd359d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View file

@ -840,6 +840,7 @@ input,
min-width: 1px;
min-height: 1px;
overflow: visible;
outline: none;
}
.tl-text-content {

View file

@ -17,7 +17,6 @@ import {
textShapeMigrations,
textShapeProps,
toDomPrecision,
useValue,
} from '@tldraw/editor'
import { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'
import { FONT_FAMILIES, FONT_SIZES, TEXT_PROPS } from '../shared/default-shape-constants'
@ -86,8 +85,6 @@ export class TextShapeUtil extends ShapeUtil<TLTextShape> {
handleDoubleClick,
} = useEditableText(id, type, text)
const zoomLevel = useValue('zoomLevel', () => this.editor.zoomLevel, [this.editor])
return (
<HTMLContainer id={shape.id}>
<div
@ -98,9 +95,6 @@ export class TextShapeUtil extends ShapeUtil<TLTextShape> {
data-isediting={isEditing}
data-textwrap={true}
style={{
outline: isEditing
? `${1.5 / zoomLevel / shape.props.scale}px solid var(--color-selected)`
: '',
fontSize: FONT_SIZES[shape.props.size],
lineHeight: FONT_SIZES[shape.props.size] * TEXT_PROPS.lineHeight + 'px',
transform: `scale(${shape.props.scale})`,