Skip to content

Instantly share code, notes, and snippets.

@easylogic
Created August 30, 2021 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easylogic/55304a1c851aacb380551dae300dd116 to your computer and use it in GitHub Desktop.
Save easylogic/55304a1c851aacb380551dae300dd116 to your computer and use it in GitHub Desktop.
부동소수점 정밀도

에디터에서 소수점 ?

path 에디터를 편하게 구현하기 위해

좌표를 0..1 사이의 값으로 모두 대체하고

width,height가 변경될때마다 scale up 을 했는데 계속적으로 오차가 발생하게 됨으로써 사용하지 않는것으로 한다.

대신에 몇가지를 정의한다.

  1. path 가 설정되는 시점 , 패스 에디터의 종료시점을 기준으로 width, height, d 를 캐쉬로 기록한다.
  2. d 가 움직이지 않고 width, height 만 움직인 경우 이전에 기록된 width, height 를 가지고 d 를 다시 복구한다.
  3. 클립패스도 동일하게 해준다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment