Skip to content

Commit

Permalink
fix: no need to convert to px (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocs committed Feb 19, 2024
1 parent d96edf0 commit a655169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -17,8 +17,6 @@
import type { ITextStyle } from '@univerjs/core';
import { BaselineOffset, BooleanNumber, ColorKit } from '@univerjs/core';

import { ptToPixel } from './utils';

export function extractNodeStyle(node: HTMLElement): ITextStyle {
const styles = node.style;
const docStyles: ITextStyle = {};
Expand Down Expand Up @@ -74,7 +72,9 @@ export function extractNodeStyle(node: HTMLElement): ITextStyle {

if (!Number.isNaN(fontSize)) {
// TODO: @JOCS, hand other CSS value unit, rem, em, pt, %
docStyles.fs = cssValue.endsWith('pt') ? ptToPixel(fontSize) : fontSize;
if (cssValue.endsWith('pt')) {
docStyles.fs = fontSize;
}
}

break;
Expand Down
Expand Up @@ -17,8 +17,6 @@
import type { ITextStyle } from '@univerjs/core';
import { BaselineOffset, BooleanNumber, ColorKit } from '@univerjs/core';

import { ptToPixel } from './utils';

export function extractNodeStyle(node: HTMLElement): ITextStyle {
const styles = node.style;
const docStyles: ITextStyle = {};
Expand Down Expand Up @@ -74,7 +72,9 @@ export function extractNodeStyle(node: HTMLElement): ITextStyle {

if (!Number.isNaN(fontSize)) {
// TODO: @JOCS, hand other CSS value unit, rem, em, pt, %
docStyles.fs = cssValue.endsWith('pt') ? ptToPixel(fontSize) : fontSize;
if (cssValue.endsWith('pt')) {
docStyles.fs = fontSize;
}
}

break;
Expand Down

0 comments on commit a655169

Please sign in to comment.