[fix] text shape outline (#1974)
This PR fixes the text shape outline. ### Change Type - [x] `patch` — Bug fix
This commit is contained in:
parent
852187058a
commit
3fa7dd359d
2 changed files with 1 additions and 6 deletions
|
@ -840,6 +840,7 @@ input,
|
||||||
min-width: 1px;
|
min-width: 1px;
|
||||||
min-height: 1px;
|
min-height: 1px;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tl-text-content {
|
.tl-text-content {
|
||||||
|
|
|
@ -17,7 +17,6 @@ import {
|
||||||
textShapeMigrations,
|
textShapeMigrations,
|
||||||
textShapeProps,
|
textShapeProps,
|
||||||
toDomPrecision,
|
toDomPrecision,
|
||||||
useValue,
|
|
||||||
} from '@tldraw/editor'
|
} from '@tldraw/editor'
|
||||||
import { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'
|
import { createTextSvgElementFromSpans } from '../shared/createTextSvgElementFromSpans'
|
||||||
import { FONT_FAMILIES, FONT_SIZES, TEXT_PROPS } from '../shared/default-shape-constants'
|
import { FONT_FAMILIES, FONT_SIZES, TEXT_PROPS } from '../shared/default-shape-constants'
|
||||||
|
@ -86,8 +85,6 @@ export class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
||||||
handleDoubleClick,
|
handleDoubleClick,
|
||||||
} = useEditableText(id, type, text)
|
} = useEditableText(id, type, text)
|
||||||
|
|
||||||
const zoomLevel = useValue('zoomLevel', () => this.editor.zoomLevel, [this.editor])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HTMLContainer id={shape.id}>
|
<HTMLContainer id={shape.id}>
|
||||||
<div
|
<div
|
||||||
|
@ -98,9 +95,6 @@ export class TextShapeUtil extends ShapeUtil<TLTextShape> {
|
||||||
data-isediting={isEditing}
|
data-isediting={isEditing}
|
||||||
data-textwrap={true}
|
data-textwrap={true}
|
||||||
style={{
|
style={{
|
||||||
outline: isEditing
|
|
||||||
? `${1.5 / zoomLevel / shape.props.scale}px solid var(--color-selected)`
|
|
||||||
: '',
|
|
||||||
fontSize: FONT_SIZES[shape.props.size],
|
fontSize: FONT_SIZES[shape.props.size],
|
||||||
lineHeight: FONT_SIZES[shape.props.size] * TEXT_PROPS.lineHeight + 'px',
|
lineHeight: FONT_SIZES[shape.props.size] * TEXT_PROPS.lineHeight + 'px',
|
||||||
transform: `scale(${shape.props.scale})`,
|
transform: `scale(${shape.props.scale})`,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue