kode-team / easylogic.studio

Fantastic Web Design Tool
https://editor.easylogic.studio
MIT License
494 stars 54 forks source link

support to control the scale with a matrix #87

Closed easylogic closed 3 years ago

easylogic commented 3 years ago

Figma 정도 되는 matrix 연산을 해보자.

  1. 멀티 아트보드를 구현한다.
  2. 아트보드는 2가지로 선택 할 수 있다.
    • 제목을 선택할 때
    • 선택 영역이 artboard 영역 전체를 포함할때
  3. selection 을 할 때
    • 한 개 일 때는 transform 까지 모두 적용된 형태
    • 여러개 일 때는 최소/최대 값에 대한 좌표를 이용해 bounded rect 를 구한다. 그런 다음에 영역을 만든다.
easylogic commented 3 years ago

단일 셀렉션 이후에 rotate 한 것을 scale 을 할 수 있게 됐다. 4방향 모두 할 수 있게 됐다. 꼭지점 말고 그냥 중간 방향도 해야하나 고민중이다.

easylogic commented 3 years ago

group 으로 matrix 를 적용하고 복원해보자.

easylogic commented 3 years ago

ParentMatrix localMatrix = Group Matrix localMatrix

easylogic commented 3 years ago

group rotate * scale 구현중

bottom right, top right 는 구현 했고 bottom left 와 top left 는 구현 해야함.

여러가지로 많은 시행착오를 겪었지만 일단 기본적인 사항은 할 수 있을 듯

다만 css 로 이루어진 렌더링이라 도형이 찌그러질 수 밖에 없는 상황에서도 찌그러지면 안됨 ..

그래서 실제로 선택한 영역이랑 다른 결과들이 나옴...

이건 너무 너무 고민이 많다.

easylogic commented 3 years ago

group 의 rotation 과 scale 을 구현했다.

svg path 의 bounding box 를 재구성해야한다.

easylogic commented 3 years ago
easylogic commented 3 years ago

https://github.com/easylogic/design/pull/1

easylogic commented 3 years ago

path 가 변경되어도 bouding box 기준으로 레이어를 다시 맞추도록 했다.

easylogic commented 3 years ago

artboard 선택 기준으로 바꿨다.

이건 나중에 multi artboard 에도 똑같이 적용된다.

easylogic commented 3 years ago
easylogic commented 3 years ago

guide line 잡는 것 까지 했기 때문에 이 이슈는 닫고

이후의 기능은 새로운 이슈로 시작하겠습니다.