import type { Entity } from '../entities/Entity'; import { copyStyle } from './modify/modify.helpers'; /** * Move entities by the difference between the start and end points * @param entities * @param deltaX * @param deltaY */ export function moveEntities(entities: Entity[], deltaX: number, deltaY: number) { for (const entity of entities) { entity.move(deltaX, deltaY); } } /** * 복제해도 색 · 층 · 선 꼴 · 투명도를 그대로 둔다(`clone()` 은 활성 층 · 흰색으로 새로 만듦). * `inPlace` = 옮기기 · 크기 · 회전처럼 같은 도형을 갈아 끼울 때 — id · 묶음까지 그대로. */ export function cloneKeepingLook(entity: Entity, inPlace = false): Entity { const copy = copyStyle(entity, entity.clone()); copy.opacity = entity.opacity; if (inPlace) { copy.id = entity.id; copy.groupId = entity.groupId; } return copy; }