Skip to content

Commit

Permalink
fix(sheet): selection size and editor position (#1743)
Browse files Browse the repository at this point in the history
* fix(sheet): selection size and editor position

* fix(sheet): remove redundant code
  • Loading branch information
DR-Univer committed Mar 29, 2024
1 parent 52c0b6e commit fd83cbf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/sheets-formula/src/common/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function getFormulaRefSelectionStyle(themeService: ThemeService, refColor
const fill = new ColorKit(refColor).setAlpha(0.05).toRgbString();
return {
id,
strokeWidth: 1.5,
strokeWidth: 1,
stroke: refColor,
// strokeDash: 10,
fill,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useDependency } from '@wendellhu/redi/react-bindings';
import React, { useEffect, useState } from 'react';

import { IEditorService, TextEditor } from '@univerjs/ui';
import { FIX_ONE_PIXEL_BLUR_OFFSET } from '@univerjs/engine-render';
import { ICellEditorManagerService } from '../../services/editor/cell-editor-manager.service';
import styles from './index.module.less';

Expand Down Expand Up @@ -81,10 +82,10 @@ export const EditorContainer: React.FC<ICellIEditorProps> = () => {
});
} else {
setState({
width: endX - startX,
height: endY - startY,
left: startX,
top: startY,
width: endX - startX - FIX_ONE_PIXEL_BLUR_OFFSET * 2,
height: endY - startY - FIX_ONE_PIXEL_BLUR_OFFSET * 2,
left: startX + FIX_ONE_PIXEL_BLUR_OFFSET,
top: startY + FIX_ONE_PIXEL_BLUR_OFFSET,
});

const editor = editorService.getEditor(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
width: 100px;
height: 50px;

border: 1.5px solid rgb(var(--primary-color));
outline: 1.5px solid rgba(var(--primary-color-hover), 0.5);
border: 1px solid rgb(var(--primary-color));
box-shadow: none;

.editor-input {
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets/src/basics/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function getNormalSelectionStyle(themeService: ThemeService): ISelectionS
const styleSheet = themeService.getCurrentTheme();
const fill = new ColorKit(styleSheet.primaryColor).setAlpha(0.07).toRgbString();
return {
strokeWidth: 1.5,
strokeWidth: 1,
stroke: styleSheet.primaryColor,
// strokeDash: 8,
fill,
Expand Down

0 comments on commit fd83cbf

Please sign in to comment.