Skip to content

Commit

Permalink
fix(edgeless): edited frame title should not be wrapped during IME in…
Browse files Browse the repository at this point in the history
…put (#4438)
  • Loading branch information
BangKk authored Aug 29, 2023
1 parent a2aff2f commit daadb64
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { assertExists } from '@blocksuite/global/utils';
import { ShadowlessElement, WithDisposable } from '@blocksuite/lit';
import {
type FrameElement,
getFontString,
getLineHeight,
getLineWidth,
} from '@blocksuite/phasor';
import { type FrameElement } from '@blocksuite/phasor';
import { html } from 'lit';
import { customElement, query } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
Expand Down Expand Up @@ -104,25 +99,12 @@ export class EdgelessFrameTitleEditor extends WithDisposable(
const padding = this._frame.padding;
const zoom = viewport.zoom;
const bound = this._frame.gridBound;
const fontSize = 16;
const fontFamily = 'sans-serif';
const lineHeight = getLineHeight(fontFamily, fontSize);
const font = getFontString({
fontSize,
fontFamily,
lineHeight: lineHeight + 'px',
});
const width =
getLineWidth(this._frame.title.toJSON(), font) +
padding[0] * 2 * zoom +
2;
const radius = this._frame.radius;
const [x, y] = viewport.toViewCoord(bound.x, bound.y);
virgoStyle = styleMap({
position: 'absolute',
left: x + 'px',
top: y + 'px',
width: width + 'px',
minWidth: '8px',
borderRadius: radius + 'px',
fontSize: '16px',
Expand Down

1 comment on commit daadb64

@vercel
Copy link

@vercel vercel bot commented on daadb64 Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blocksuite – ./packages/playground

blocksuite-toeverything.vercel.app
blocksuite-five.vercel.app
blocksuite-git-master-toeverything.vercel.app

Please sign in to comment.