fix(editor): stageOverlay不应受编辑器zoom影响

This commit is contained in:
roymondchen 2024-05-23 19:32:00 +08:00
parent 5ce099c11d
commit 47c42222b3
3 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export const useStage = (stageOptions: StageOptions) => {
const stage = new StageCore({ const stage = new StageCore({
render: stageOptions.render, render: stageOptions.render,
runtimeUrl: stageOptions.runtimeUrl, runtimeUrl: stageOptions.runtimeUrl,
zoom: zoom.value, zoom: stageOptions.zoom ?? zoom.value,
autoScrollIntoView: stageOptions.autoScrollIntoView, autoScrollIntoView: stageOptions.autoScrollIntoView,
isContainer: stageOptions.isContainer, isContainer: stageOptions.isContainer,
containerHighlightClassName: stageOptions.containerHighlightClassName, containerHighlightClassName: stageOptions.containerHighlightClassName,

View File

@ -90,6 +90,7 @@ class StageOverlay extends BaseService {
public createStage(stageOptions: StageOptions = {}) { public createStage(stageOptions: StageOptions = {}) {
return useStage({ return useStage({
...stageOptions, ...stageOptions,
zoom: 1,
runtimeUrl: '', runtimeUrl: '',
autoScrollIntoView: false, autoScrollIntoView: false,
render: async (stage: StageCore) => { render: async (stage: StageCore) => {

View File

@ -150,6 +150,7 @@ export interface StageOptions {
renderType?: RenderType; renderType?: RenderType;
guidesOptions?: Partial<GuidesOptions>; guidesOptions?: Partial<GuidesOptions>;
disabledMultiSelect?: boolean; disabledMultiSelect?: boolean;
zoom?: number;
} }
export interface StoreState { export interface StoreState {