ccchart icon indicating copy to clipboard operation
ccchart copied to clipboard

ccchartの上にレイヤーとしてのキャンバスを重ねていろいろする

Open toshirot opened this issue 7 years ago • 6 comments

ccchartの上にレイヤーとしてのキャンバスを重ねてみた https://ccchart.org/test/layer-canvas/layer-20171231.html

toshirot avatar Dec 31 '17 00:12 toshirot

・描画された図形のHoverテスト https://ccchart.org/test/layer-canvas/layer-20171231-2.html

toshirot avatar Dec 31 '17 03:12 toshirot

斜めの線にかぶせるホーバー表示用の矩形を描くのに rotateするときにたとえば moveTo の x,y が結構あると大きな回転角でわけわからないことになる

というわけで、基準点を0,0 にしてからその分を translate するという手を思いついた。

toshirot avatar Dec 31 '17 22:12 toshirot

メモ 重ね合わせた時の lineWidthの起点について

hoverline

https://ccchart.org/test/layer-canvas/layer-20171231-3-2.html

toshirot avatar Jan 01 '18 03:01 toshirot

こうかな?

hoverline2

https://ccchart.org/test/layer-canvas/layer-20171231-3-3.html

結果 少しまだずれがあるけど概ね予想通り hoverline3

toshirot avatar Jan 01 '18 04:01 toshirot

まだ起点がずれてるけど動きが面白いのでメモ https://ccchart.org/test/layer-canvas/layer-20171231-3-4.html

toshirot avatar Jan 01 '18 05:01 toshirot

で、選択図形は細かい計算するより、これで計算量少ないし良いんじゃないか? https://ccchart.org/test/layer-canvas/layer-20171231-3-5.html

toshirot avatar Jan 01 '18 06:01 toshirot